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 would like to hide option of template from the menu side in wp-admin.

I tried this code but its not work , its no hide the option:-

//hide in admin menu
add_action( 'admin_menu', 'wpse121406_hide_pages_comments_m' );
function wpse121406_hide_pages_comments_m() {
    remove_menu_page('admin.php?page=options-framework');
}

and try this and not work:-

function remove_menus(){
  remove_menu_page( 'options-general.php' );        //Settings
}
add_action( 'admin_menu', 'remove_menus' );

So what can i do to hide this link :-

admin.php?page=options-framework
share|improve this question
add comment

1 Answer 1

In this case, the issue is due to the queue order. You should change the priority of the execution of your add_action hook to something large, to ensure that it executes as late as possible. add_action's 3rd argument is the priority represented by an integer. Lower #'s gain priority in execution over higher #'s.

add_action( 'admin_menu', 'remove_menus', 999999 );

It's likely that the theme you're trying to hide the options page for doesn't have it's execution priority that low and therefore the hook will have been created before your add action argument is fired.

share|improve this answer
    
i will do that but still found in menu –  user3133976 Jan 11 at 11:03
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.