Support » Developing with WordPress » add_menu_page Capability Not Working

  • Resolved Jack Reacher

    (@iftieaq)


    Hi,

    I am creating a plugin and I want to allow the Editors to access the plugin menu page. I set the capability to publish_pages but its not working. The option page is showing to admin user but not editor user. What have I done wrong?

    function twsa_register_menu() {
    
        add_menu_page(
            __('Agents Stats', 'textdomain'),
            __('Agents Stats', 'textdomain'),
            'publish_pages',
            'wcas',
            'tw_agents_stats_page',
            'dashicons-chart-pie'
        );
     
    }
    
    // create custom plugin settings menu
    add_action('admin_menu', 'twsa_register_menu');
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Since this topic is marked as resolved, I’m assuming you found the problem, since there’s nothing wrong with the code you posted. I’m mainly replying just so resolved 1 post topics like this fall off of the “No Replies” list. If the resolved status is in error, go ahead and reply here.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.