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 am able to add Menu to the Dashboard using the below code, it can be viewed by an administrator. That menu doesn't appear when logged in as an Author or a Subscriber. How to make sure every user can view the custom added menus.

//Add Menu Page


add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page(){
add_dashboard_page( 'custom menu title', 'Test', 'manage_options', 'custompage', 'my_custom_menu_page', plugins_url( 'test/images/icon.png' ), 6 ); 
}


function my_custom_menu_page(){
echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>';
    echo '<h2>Test</h2>';
    echo 'Test';

echo '</div>';
}
share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You have to use the right capability for this. You chose manage_options, which by default only users with an Administrator user role have.

So, change it to read or exist, for instance, and every user will be able to see and access the menu.

add_dashboard_page( 'custom menu title', 'Test', 'read', 'custompage', 'my_custom_menu_page', plugins_url( 'test/images/icon.png' ), 6 ); 
share|improve this answer
1  
Thank you so much.. Works perfect! :-) –  Vijay Rajasekaran Feb 15 at 11:31
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.