WordPress customizer sanitization code

WordPress hidden customize option from admin bar

It’s great if you frequently make changes with the use of the customize option. However, for me personally, I rather see it removed.

So I have hidden this Customize option within the admin bar in WordPress by editing my theme’s functions.php file. I added this piece of code to it:

function remove_customize() {
	global $wp_admin_bar;
	$wp_admin_bar->remove_menu('customize');
}
add_action( 'wp_before_admin_bar_render', 'remove_customize' );

Top: default WordPress admin bar Bottom: Customize menu item removed

 

add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*