Get the autofocused constructs.
public get_autofocus ( ) : array | ||
return | array | { Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. @type string [$control] ID for control to be autofocused. @type string [$section] ID for section to be autofocused. @type string [$panel] ID for panel to be autofocused. } |
/** * Test get_autofocus()/set_autofocus() methods. * * @see WP_Customize_Manager::get_autofocus() * @see WP_Customize_Manager::set_autofocus() */ function test_autofocus() { $this->assertEmpty($this->manager->get_autofocus()); $this->manager->set_autofocus(array('unrecognized' => 'food')); $this->assertEmpty($this->manager->get_autofocus()); $autofocus = array('control' => 'blogname'); $this->manager->set_autofocus($autofocus); $this->assertEquals($autofocus, $this->manager->get_autofocus()); $autofocus = array('section' => 'colors'); $this->manager->set_autofocus($autofocus); $this->assertEquals($autofocus, $this->manager->get_autofocus()); $autofocus = array('panel' => 'widgets'); $this->manager->set_autofocus($autofocus); $this->assertEquals($autofocus, $this->manager->get_autofocus()); $autofocus = array('control' => array('blogname', 'blogdescription')); $this->manager->set_autofocus($autofocus); $this->assertEmpty($this->manager->get_autofocus()); }