0

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
0

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.

  • i will do that but still found in menu – user3133976 Jan 11 '14 at 11:03

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.