• Hi guys, I want to change the value of WP Customizer Image Control using JavaScript API.

    I tried to change the value with below code. But it does not work.

    wp.customize.instance(‘background-image’).set( ‘http://urltoimage.jpg’ );

    Anyone can help, please?

    Thanks Simon

Viewing 1 replies (of 1 total)
  • I have a loop (for presets) that uses this code, which works.

    	var old = {};
    	var setting = wp.customize( id );
    	if ( setting ) {
    		old[id] = setting.get();
    		setting.set( value );
    	}
    
Viewing 1 replies (of 1 total)

The topic ‘How to change theme customizer image control value using JavaScript’ is closed to new replies.