Support » Plugin: Broadcast » Can’t select cpt for custom role and capabilities

  • Resolved jonkristian


    When creating a new post in my custom post type the “Broadcast to” comes up empty if I’m logged in with custom user role, when logged in as admin it comes up and works just fine.

    So which capability am I missing that makes this available?

    Currently my role is selected on all options under Broadcast > Roles and the following caps is added to my role:

    • edit_operations
    • edit_operation
    • edit_others_operations
    • publish_operations
    • read_operation
    • read_private_operations
    • delete_operation

    My custom post type caps is:

    'edit_post'             => 'edit_operation',
    'read_post'             => 'read_operation',
    'delete_post'           => 'delete_operation',
    'edit_posts'            => 'edit_operations',
    'edit_others_posts'     => 'edit_others_operations',
    'publish_posts'         => 'publish_operations',
    'read_private_posts'    => 'read_private_operations',

    And arguments:

    'label'                 => __( 'Driftsmelding', '' ),
    'description'           => __( 'Driftsmeldinger', '' ),
    'labels'                => $labels,
    'supports'              => array( 'title', 'editor', ),
    'hierarchical'          => true,
    'public'                => true,
    'show_ui'               => true,
    'show_in_menu'          => true,
    'menu_position'         => 5,
    'menu_icon'             => 'dashicons-format-status',
    'show_in_admin_bar'     => true,
    'show_in_nav_menus'     => true,
    'can_export'            => true,
    'has_archive'           => true,
    'exclude_from_search'   => false,
    'publicly_queryable'    => true,
    'rewrite'               => $rewrite,
    'capabilities'          => $capabilities,
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author edward_plainview


    There are two pieces of code in BC that decide whether the blog will show up in the list:

    get_blogs_of_user( $action->user_id )

    meaning the user must be a member of the blog


    current_user_can( ‘edit_posts’ );

    which … is self-explanatory.

    The pieces of code you’ll find in src/ThreeWP_Broadcast.php

    Well I’ve added the cap “edit_posts” to my role, but that didn’t seem to help either.

    Plugin Author edward_plainview


    I’m not sure how much more I can help. Those are the two calls that are the most important, so I suggest looking at their return values to see what is going on.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t select cpt for custom role and capabilities’ is closed to new replies.