Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I can't see to get it. The capabilities fail to appear when using plugins like "Capability Manager" or "Members" to view a list of available capabilities.

This is the code I'm attempting to use:

add_action( 'init', 'register_taxonomy_spot_tag' );

function register_taxonomy_spot_tag() {

    $labels = array( 
        'name' => _x( 'Spot Tags', 'spot tag' ),
        'singular_name' => _x( 'Spot Tag', 'spot tag' ),
        'search_items' => _x( 'Search Spot Tags', 'spot tag' ),
        'popular_items' => _x( 'Popular Spot Tags', 'spot tag' ),
        'all_items' => _x( 'All Spot Tags', 'spot tag' ),
        'parent_item' => _x( 'Parent Spot Tag', 'spot tag' ),
        'parent_item_colon' => _x( 'Parent Spot Tag:', 'spot tag' ),
        'edit_item' => _x( 'Edit Spot Tag', 'spot tag' ),
        'update_item' => _x( 'Update Spot Tag', 'spot tag' ),
        'add_new_item' => _x( 'Add New Spot Tag', 'spot tag' ),
        'new_item_name' => _x( 'New Spot Tag Name', 'spot tag' ),
        'separate_items_with_commas' => _x( 'Separate spot tags with commas', 'spot tag' ),
        'add_or_remove_items' => _x( 'Add or remove spot tags', 'spot tag' ),
        'choose_from_most_used' => _x( 'Choose from the most used spot tags', 'spot tag' ),
        'menu_name' => _x( 'Spot Tags', 'spot tag' ),
    );

    $args = array( 
        'labels' => $labels,
        'public' => true,
        'show_in_nav_menus' => true,
        'show_ui' => true,
        'show_tagcloud' => true,
        'hierarchical' => false,

        'rewrite' => true,
        'query_var' => true,
        'capabilities' => array(
            'manage_terms' => 'manage_spot_tags',
            'edit_terms' => 'edit_spot_tags',
            'delete_terms' => 'delete_spot_tags',
            'assign_terms' => 'assign_spot_tags'
        )
    );

    register_taxonomy( 'spot_tag', array('spot'), $args );
}

I generated the above code with this tool: http://themergency.com/generators/wordpress-custom-taxonomy/

share|improve this question
add comment

1 Answer 1

Try using add_cap .... adding new capability and creating the capability first in functions.php, i cant locate anything that says capabilities can be created in registering a taxonomy, but you can certainly assign them there..

share|improve this answer
    
Thanks for the reply. I already saw that. The code I used in the example was generated at themergency.com/generators/wordpress-custom-taxonomy. It seems to work very nicely for adding post types (capabilities are added automatically). But I guess that's not the case with taxonomies (as the site obviously claims with the automatic generator). –  trusktr Jul 1 '11 at 6:24
    
I see if I can create the capability first and see what happens... –  trusktr Jul 1 '11 at 6:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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