Check if we are currently using the WordPress customizer

Note : the following code snippet requires advanced WordPress developer skills. There's no guarantee that this snippet works as is with the latest version of our themes, and with the latest version of WordPress. That's why you need to always test any code snippets in a staging environment before implementing it in a production site.

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 :

 Hope this helps!

Related Snippets you may also like

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

  • Silvia

    Hi Nicolas,

    Sorry, I know this is not the matter of your comment but I didn’t find where to ask for help.
    i have just started using “OptimizePress Landing Page” software and I found that it doesn’t work with “Customizr” theme….
    I have tested with another theme and the landig page work fine.

    Is there any issue with Customizr and landing pages? How can I fix it?

    Thanks in advanced.

Comments are closed.