I recently added some custom post type user capabilities when using register_post_type() function.

register_post_type('registration', [

    'capabilities' => [
        'edit_post'                 => 'edit_registration',
        'read_post'                 => 'read_registration',
        'delete_post'               => 'delete_registration',
        'edit_posts'                => 'edit_registrations',
        'edit_others_posts'         => 'edit_others_registrations',
        'publish_posts'             => 'publish_registrations',
        'read_private_posts'        => 'read_private_registrations',
        'delete_posts'              => 'delete_registrations',
        'delete_private_posts'      => 'delete_private_registrations',
        'delete_published_posts'    => 'delete_published_registrations',
        'delete_others_posts'       => 'delete_others_registrations',
        'edit_private_posts'        => 'edit_private_registrations',
        'edit_published_posts'      => 'edit_published_registrations',
        'create_posts'              => 'create_registrations'
    'map_meta_cap' => true


And when I refreshed the User Role Editor plugin capability manager page, the above the capabilities appeared immediately as options I could tick to assign to user roles. Because i'm using 'map_meta_cap' => true.

But when I do the same with the register_taxonomy() function...

$args = [
    'capabilities' => [
        'manage_terms' => 'manage_seasons',
        'edit_terms' => 'edit_seasons',
        'delete_terms' => 'delete_seasons',
        'assign_terms' => 'assign_seasons'

register_taxonomy('season', ['registration'], $args);

These taxonomy capabilities don't show up as options in the user role editor plugin?

Any ideas would be great. Just need my taxonomy capabilities to be added dynamically not manually.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.