The customize_register is hooked to wp_loaded which runs on the front end too, but when in the frontend I access the global wp_customize variable, it's empty. I'm wondering, does WordPress removes the registered settings and section when the site is viewed? Is there a way to access the registered options in the body_class hook for example?

  • Can you add any relevant code please?
    – s_ha_dum
    Commented Jan 27, 2013 at 21:12

1 Answer 1


Yes this right. The var is only for customize the theme and works not in frontend, overhead and not usefull. After the user customize the theme, than was saved in options. Use the default functions to get the data, like the function get_option().

See also this theme file as example. It add stylesheets in frontend and use the data from the customizer. But this class use a method from the parent class and tbis method use get_option() to get the data.

  • Hi, I don't want the value for the option, but the registered settings. I want to call the sanitization callback registered for the setting on the front end, but unfortunately there seems to be no way around it other than to create a wrapper for the customization API and let that wrapper do the work. It's an ugly solution, very repetitive and frankly, unnecessary.
    – Hassan
    Commented Jan 27, 2013 at 22:22
  • What is the difference for the option and settings for you? The user save on the customizer the settings inside the options table, in a sanitized string. You get it as array and can use it.
    – bueltge
    Commented Jan 28, 2013 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.