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.

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' );

    }
share|improve this question

1 Answer 1

up vote 1 down vote accepted
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

share|improve this answer
    
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 at 14:36
    
@SanjayNakate Put code with "edit_others_posts" and then login as editor and try. –  Rajeev Vyas Jul 19 at 14:39
    
i did but adminisrator canot use this plugin after putting this code –  Sanjay Nakate Jul 19 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 at 17:16
    
good answer finally its working for both admin and editor user roles –  Sanjay Nakate Jul 30 at 9:36

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.