0

I created a custom taxonomy that it is being used for the product post type of woocommerce.

For some reason when you go to the edit screen it is appearing disabled.

This is the code that I'm using to generate the taxonomy:

add_action( 'init', 'mk_restrict_product_by_tag', 0 );
function mk_restrict_product_by_tag() {

$labels = array(
    'name'                       => 'Restricted Tags',
    'singular_name'              => 'Restricted Tag',
    'menu_name'                  => 'Restricted Tags',
    'all_items'                  => 'All Restricted Tags',
    'parent_item'                => 'Parent Restricted Tag',
    'parent_item_colon'          => 'Parent Restricted Tag:',
    'new_item_name'              => 'New Restricted Tag',
    'add_new_item'               => 'Add New Restricted Tag',
    'edit_item'                  => 'Edit Restricted Tag',
    'update_item'                => 'Update Restricted Tag',
    'view_item'                  => 'View Restricted Tag',
    'separate_items_with_commas' => 'Separate Restricted Tags with commas',
    'add_or_remove_items'        => 'Add or remove Restricted Tags',
    'choose_from_most_used'      => 'Choose from the most used',
    'popular_items'              => 'Popular Restricted Tags',
    'search_items'               => 'Search Restricted Tags',
    'not_found'                  => 'Not Found',
    'no_terms'                   => 'No Restricted Tags',
    'items_list'                 => 'Restricted Tags list',
    'items_list_navigation'      => 'Restricted Tags list navigation'
);
$args = array(
    'labels'                     => $labels,
    'hierarchical'               => false,
    'public'                     => false,
    'show_ui'                    => true,
    'show_admin_column'          => true,
    'show_in_nav_menus'          => false,
    'show_tagcloud'              => false,
    'rewrite'                    => false,
    'show_in_quick_edit'         => true,
    'capabilities' =>
            array (
              'manage_terms' => 'manage_categories',
              'edit_terms' => 'manage_categories',
              'delete_terms' => 'manage_categories',
              'assign_terms' => 'edit_posts',
            )
);
register_taxonomy( 'mk_restricted_tag', array('user','product'), $args );
}

The HTML that WordPress is generating:

    <div id="tagsdiv-mk_restricted_tag" class="postbox " >
    <button type="button" class="handlediv button-link" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Restricted Tags</span><span class="toggle-indicator" aria-hidden="true"></span></button>
    <h2 class='hndle'><span>Restricted Tags</span></h2>
    <div class="inside">
        <div class="tagsdiv" id="mk_restricted_tag">
            <div class="jaxtag">
                <div class="nojs-tags hide-if-js">
                    <label for="tax-input-mk_restricted_tag">Add or remove Restricted Tags</label>
                    <p><textarea name="tax_input[mk_restricted_tag]" rows="3" cols="20" class="the-tags" id="tax-input-mk_restricted_tag"  disabled='disabled' aria-describedby="new-tag-mk_restricted_tag-desc"></textarea></p>
                </div>
            </div>
            <div class="tagchecklist"></div>
        </div>
    </div>
</div>

As you can see the text area is Disabled. If I convert the taxonomy to hierarchical the checboxes are disabled (and I do get to see the terms).

Any idea why this is happening?

1
  • Are you logged-in as admin ?
    – Sumit
    Mar 18, 2016 at 6:21

1 Answer 1

0

Fixed.

I had the members plugin installed and it was overwriting some permissions by giving priority to denied options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.