Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding field param option to remove WP default tax meta boxes #593

Merged
merged 1 commit into from
Aug 2, 2016

Conversation

c3mdigital
Copy link

When adding any of the cmb2 taxonomy_* metaboxes you get both the built in wp box and the cmb2 box. This pull request gives a field option remove_default.

Is this the best place to hook this in? Seemed logical to me but I'm not real familiar with cmb2 yet.

@jtsternberg
Copy link
Member

Not super sure what you mean. Do you think you can provide screenshots for before/after?

@tw2113
Copy link
Contributor

tw2113 commented Aug 2, 2016

Has a typo in the 2nd remove_meta_box() for non-hierarchical taxonomies, before it should be merged in.

@jtsternberg basically with this one, it allows for adding 'remove_default' => true to the field declaration and have CMB2 hide the default category/tag metaboxes in favor of the CMB2-provided metabox.

$cmb_demo->add_field( array(
    'name'     => __( 'Test Taxonomy Multi Checkbox', 'cmb2' ),
    'desc'     => __( 'field description (optional)', 'cmb2' ),
    'id'       => $prefix . 'multitaxonomy',
    'type'     => 'taxonomy_multicheck',
    'taxonomy' => 'post_tag',
    'remove_default' => true,
) );

@tw2113
Copy link
Contributor

tw2113 commented Aug 2, 2016

TravisCI failed cause PHP5.2 isn't installed or something, understandably so.

@jtsternberg jtsternberg merged commit e4c2843 into CMB2:trunk Aug 2, 2016
@jtsternberg
Copy link
Member

Refreshed and merged: 6ee7222
Thanks @c3mdigital!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants