set_autofocus example




wp_reset_vars( array( 'url', 'return', 'autofocus' ) );
if ( ! empty( $url ) ) {
    $wp_customize->set_preview_url( wp_unslash( $url ) );
}
if ( ! empty( $return ) ) {
    $wp_customize->set_return_url( wp_unslash( $return ) );
}
if ( ! empty( $autofocus ) && is_array( $autofocus ) ) {
    $wp_customize->set_autofocus( wp_unslash( $autofocus ) );
}

$registered             = $wp_scripts->registered;
$wp_scripts             = new WP_Scripts();
$wp_scripts->registered = $registered;

add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 );

/** * Fires when Customizer controls are initialized, before scripts are enqueued. * * @since 3.4.0 */
Home | Imprint | This part of the site doesn't use cookies.