get_autofocus() публичный Метод

Get the autofocused constructs.
С версии: 4.4.0
public get_autofocus ( ) : array
Результат 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. }
Пример #1
0
 /**
  * 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());
 }