I am wondering if it is possible to directly interop with the wp.customize api to get a value of a theme customizer setting. The way I am doing it now is using ajax to get a response from a php function. I seem to be having alot of issues with it.

I know that you can bind to theme customizer controls using jquery with the wp.customize api, although I am wondering if I can directly access a setting from jquery?

EDIT: More information

I know that you can interact with controls directly through the API like this:

/** Site title and description. */
wp.customize( 'blogname', function( value ) {
    value.bind( function( to ) {
        $( '.site-title a' ).html( to );
    } );
} );

I am wondering if it is possible using the same API to directly access theme setting values, using jquery alone?

If not I think it wouldn't be hard and would be beneficial to extend the wp.customize api(and maybe all other wp functions for that matter) to do exactly what I am manually doing with ajax and php, so this way it would be possible for users to only use jquery themselves to interact with wp functions and have wordpress do the dirty work behind the scenes. This may be a good feature for a later version of WP.

1 Answer 1


Not sure what you try to accomplish, but you can get a value by key using the wp.customize object:


sorry no jQuery here, just javascript, and yes, the extra () are intentional.

Edit: Full overview of all settings:


Edit II:

different approach:

a) lookup all available settings by using


b) one can not access the value directly, so


won't work. But, if you make it a function call it should work:


I don't think it's intended to be used this way ( if there is an intention of usage at all ) but it works for me. I've just inspected the wp.customize object and didn't look up how WP constructs this _value object. It's a good idea to test if a setting is available and if it is a function,and finally you can use jQuery ;)

if ( jQuery.isFunction(wp.customize._value.blogname) ) {
// do stuff

or like our parents would have made it ;)

if(typeof wp.customize._value.blogname === 'function')
    //do stuff
  • Thank you soo much. I can't even believe this. I spent like 5 days on a hackish work around. Soo frustrating. Although I am ecstatic that I know I can do this now. SE will allow me to award the bounty in 14 more hours. I selected your answer though, since it has been solved. Will be back. Thanks again. Commented Dec 29, 2013 at 7:17
  • There seems to be one issue. I can only get the full overview to work. When trying to get individual settings, I get an error saying it is not a function. I have been tinkering with it to get the individual setting value to output into the console, to no avail. Commented Dec 29, 2013 at 7:55
  • It seems that my issue was me trying to write it into the console. Which I could only get to work if I created a function that accessed a theme setting like the one in the OP, and declared a global variable outside of the function, and then define the variable inside the function with the wp.customize._value.blogname(); method. I seem to have alot of .net habits I need to drop in order to be more productive with jquery. Good news is when outputting the method directly, within jquery it works great and that's what I needed. Thanks again. EDIT: 3 more hours and it can be awarded. Commented Dec 29, 2013 at 18:44
  • According to api, it should be done like this. wp.customize.value('show_on_front').get()
    – Jashwant
    Commented Jun 13, 2015 at 21:12
  • 6
    It's even simpler: wp.customize('show_on_front').get()
    – Ian Dunn
    Commented Jul 4, 2015 at 0:38

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.