/** * Constructor. * * Any supplied $args override class property defaults. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id An specific ID of the section. * @param array $args Section arguments. */ public function __construct($manager, $id, $args = array()) { $this->manager = $manager; parent::__construct($this->type, $id, $args); add_action("fields_api_section_active_{$this->object_type}", array($this, 'customize_section_active'), 10, 2); add_action("fields_api_render_section_{$this->object_type}", array($this, 'customize_render_section')); add_action("fields_api_render_section_{$this->object_type}_{$this->id}", array($this, 'customize_render_section_id')); }
/** * Constructor. * * Any supplied $args override class property defaults. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id An specific ID of the section. * @param array $args Section arguments. */ public function __construct($manager, $id, $args = array()) { $this->manager = $manager; $this->object_name = $manager->get_customizer_object_name(); // Backwards compatibility for old property names foreach ($this->property_map as $backcompat_arg => $actual_arg) { if (isset($args[$backcompat_arg])) { $args[$actual_arg] = $args[$backcompat_arg]; unset($args[$backcompat_arg]); } } parent::__construct($this->object_type, $id, $args); if (!has_action("fields_api_section_active_{$this->object_type}", array('WP_Customize_Section', 'customize_section_active'))) { add_action("fields_api_section_active_{$this->object_type}", array('WP_Customize_Section', 'customize_section_active'), 10, 2); } if (!has_action("fields_api_render_section_{$this->object_type}", array('WP_Customize_Section', 'customize_render_section'))) { add_action("fields_api_render_section_{$this->object_type}", array('WP_Customize_Section', 'customize_render_section')); } if ('' !== $this->id) { add_action("fields_api_render_section_{$this->object_type}_{$this->object_name}_{$this->id}", array($this, 'customize_render_section_id')); } }