On this page
WP_Customize_Manager::set_autofocus( array $autofocus )
Sets the autofocused constructs.
Parameters
$autofocusarray Required-
Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.
controlstringID for control to be autofocused.sectionstringID for section to be autofocused.panelstringID for panel to be autofocused.
Source
File: wp-includes/class-wp-customize-manager.php. View all references
public function set_autofocus( $autofocus ) {
$this->autofocus = array_filter( wp_array_slice_assoc( $autofocus, array( 'panel', 'section', 'control' ) ), 'is_string' );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_array_slice_assoc() wp-includes/functions.php | Extracts a slice of an array, given a list of keys. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_manager/set_autofocus