Viewing 1 replies (of 1 total)
  • If you make your control a custom type, you can load JS in the control pane that easily extends the Control

    ( function( wp ) {
      wp.customize.controlConstructor['myspecialcheckbox'] = wp.customize.Control.extend( {
        ready: function() {
          var control = this;
          control.container.find( 'input[type="checkbox"]' ).on( 'change', function() {
          //toggle other ones
          }
        } );
      } );
    } )( wp );

    You can also use the controls action to load your JS in the Control pane if it’s not tied to a custom control.
    add_action( 'customize_controls_enqueue_scripts', 'my_customize_pane_enqueue' );
    with something like

    ( function( wp ) {
      wp.customize.control( 'my_setting', function( control ) {
        control.on('click', function( ) {
          control.setting.whatever = 'on'; // whatever you are doing to the setting
        } );
      } );
    } )( wp );
Viewing 1 replies (of 1 total)

The topic ‘Modify Customizer control labels based on Customizer selections’ is closed to new replies.