0

I have a button (custom control) within a section, which on click must get all controls in the section. This is the click event for the button:

    wp.customize.control( 'reset_control', function( control ) {
    control.container.find( 'button' ).on( 'click', function(e) {
        e.preventDefault();
        wp.customize.section.each( function ( section ) {
            console.info( section );
        } );
        console.info( control.section.controls );
    } );
} );

I just have tried everything ..... I can get all the sections with:

            ... wp.customize.section.each( function ( section ) {
            console.info( section );
        } );
.....

, including and the active, but I can't get the current section (detect it) and all controls in it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.