0

How do i give access to user role editor without using any plugin using bellow function

function HSA_add_to_menu() 

    {

        add_options_page('Horizontal scrolling announcement',  __('Horizontal Scrolling', WP_hsa_UNIQUE_NAME), 'manage_options', 'horizontal-scrolling-announcement', 'HSA_admin_options' );

    }
1
function HSA_add_to_menu() 

    {

        add_options_page('Horizontal scrolling announcement',  __('Horizontal Scrolling', WP_hsa_UNIQUE_NAME), 'edit_others_posts', 'horizontal-scrolling-announcement', 'HSA_admin_options' );

    }

http://codex.wordpress.org/Roles_and_Capabilities#Editor

  • its showing two menus of plugin if put both and old code and if put this code only its showing message don't have permission to access this page – Sanjay Nakate Jul 19 '14 at 14:36
  • @SanjayNakate Put code with "edit_others_posts" and then login as editor and try. – Rajeev Vyas Jul 19 '14 at 14:39
  • i did but adminisrator canot use this plugin after putting this code – Sanjay Nakate Jul 19 '14 at 14:40
  • The capabilities parameter of add_options_page only controls the display of the menu item. The function that displays the content of the options page should also be checking capabilities and if you can see the menu item but not access it, you need to check the capabilities restriction of that function. – karpstrucking Jul 19 '14 at 17:16
  • good answer finally its working for both admin and editor user roles – Sanjay Nakate Jul 30 '14 at 9:36

Your Answer

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

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