Check if we are currently using the WordPress customizer

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

You can search the user’s forum or ask the user community by opening a new thread in the Customizr theme forum. Before opening a new topic, you might want to follow the troubleshooting steps..

Howdy developer!

Sometimes it might be the case that you need to execute actions only if the user is in the customization context => using the WordPress customizer. Here’s a quick snippet to check that.

I use the following condition statement, checking if the $_REQUEST[‘wp_customize’]  is defined to verify that :

if ( isset( $_REQUEST['wp_customize'] ) ) {

//some code to execute while in the customizer

}

else {

//some code to execute if not in the customizer

}

 Hope this helps!

One thought on “Check if we are currently using the WordPress customizer”

Comments are closed.