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 to hide customize menu and another submenu on wordpress?

I already hide some submenu on wordpress like

function hiden() {
    remove_submenu_page( 'themes.php', 'widgets.php' );//widget
    remove_submenu_page( 'themes.php', 'theme-editor.php' ); //editor
    remove_submenu_page( 'themes.php', 'theme_options' );} //theme-option
add_action('admin_head', 'hiden');

but if I want to remove customize menu remove_submenu_page( 'themes.php', 'customize.php' )... but It can't... Anybody can help me, whats wrong ??? Thank you

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If you deal with wp menus you shoudl use admin_menu filter.

add_filter('admin_menu', 'admin_menu_filter',500);
function admin_menu_filter(){
    remove_submenu_page( 'themes.php', 'widgets.php' );//widget
    remove_submenu_page( 'themes.php', 'theme-editor.php'); //editor
    remove_submenu_page( 'themes.php', 'theme_options' ); //theme-option
}
add_action('admin_print_styles-themes.php', 'hide_customize');
function hide_customize(){
    echo '<style>#customize-current-theme-link{display:none;}</style>';
}

you can place it to your plugin or functions.php in your theme.

share|improve this answer
    
its same can not work for hide customize... function admin_menu_filter(){ remove_submenu_page( 'themes.php', 'customize.php'); } add_filter('admin_menu', 'admin_menu_filter',500); –  Juan Lie Nov 14 '12 at 10:58
    
if you want just "hide" but not to remove page, you can use a updated sample. –  Oleg Butuzov Nov 14 '12 at 13:14
    
great idea @code monkey. Thanks so much... But anyway, I wanna be know... how to disable customize option because if just hiden, user can fill customize.php in url ??? –  Juan Lie Nov 15 '12 at 15:27
    
if you will remove capability 'edit_theme_options' of user roles of your user wouldn't be able to user customization url. but even edit theme options... –  Oleg Butuzov Nov 15 '12 at 15:30
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.