Add the “Customizer” Menu Back to Your WP Admin

Add The Customizer Menu Back To Your Wp Admin Image 3

If you’re using a full site editing theme, aka a new Block Theme, aka not a Classic Theme, aka… If your “Customize” menu link disappeared… then have we got a deal for you! Just add it back!

Before… eugghh 🤢

➡️

After… ahhh 🥹

What it does…

Adds the “Customize” link under “Appearance” in the WordPress Admin menus.

Why it does it…

If you’re using a modern Block Theme with Full Site Editing, then you might not have a “Customize” link to access the built-in WP Theme Customizer. This is a problem when you need to edit something like the WooCommerce Store Notice or other plugins that haven’t been fully updated to work with modern themes.

How it does it…

Returns true on the `customize_register` method to ensure the “Customize” menu is always available. 

Wanna know more? Okay…

The add_action( 'customize_register', '__return_true' ) code in WordPress adds a new action to the customize_register hook.

The customize_register hook is used in WordPress to add new settings, sections, and controls to the WordPress Customizer, which is a feature that allows users to customize the appearance and functionality of their WordPress site in a live preview environment.

In this case, the code is using the __return_true() function as the callback function for the action. This function is a built-in WordPress function that simply returns true.

By adding this action to the customize_register hook and using __return_true() as the callback function, we are essentially telling WordPress to always return true when the Customizer is being registered, which can be useful if we want to allow all customizations without any restrictions or limitations.

In summary, this code simply enables all customizations in the WordPress Customizer by returning true when the customize_register hook is being registered.

Use the JSON file for easily importing into your CodeSnippetsPro plugin. Use the PHP file or just copy/paste the code sample into your functions.php if you’re not using CodeSnippetsPro.

Related Snips

Leave a Reply

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