/** * Constructor. * * Supplied $args override class property defaults. * * If $args['fields'] is not defined, use the $id as the field ID. * * @since 3.4.0 * * @param WP_Customize_Manager $manager * @param string $id * @param array $args */ public function __construct($manager, $id, $args = array()) { $this->manager = $manager; $this->object_name = $this->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 (empty($this->active_callback)) { $this->active_callback = array($this, 'active_callback'); } if (!has_action('fields_render_control_' . $this->object_type, array('WP_Customize_Control', 'customize_render_control'))) { add_action('fields_render_control_' . $this->object_type, array('WP_Customize_Control', 'customize_render_control')); } if (!has_filter('fields_control_active_' . $this->object_type, array('WP_Customize_Control', 'customize_control_active'))) { add_filter('fields_control_active_' . $this->object_type, array('WP_Customize_Control', 'customize_control_active'), 10, 2); } if ('' !== $this->id) { add_action('fields_render_control_' . $this->object_type . '_' . $this->object_name . '_' . $this->id, array('WP_Customize_Control', 'customize_render_control_id')); } }
/** * Constructor. * * Supplied $args override class property defaults. * * If $args['fields'] is not defined, use the $id as the field ID. * * @since 3.4.0 * * @param WP_Customize_Manager $manager * @param string $id * @param array $args */ public function __construct($manager, $id, $args = array()) { if (isset($args['type'])) { $this->type = $args['type']; } $this->manager = $manager; parent::__construct($this->type, $id, $args); if (empty($this->active_callback)) { $this->active_callback = array($this, 'active_callback'); } add_action('fields_render_control_' . $this->object_type, array($this, 'customize_render_control')); add_action('fields_render_control_' . $this->object_type . '_' . $this->id, array($this, 'customize_render_control_id')); add_filter('fields_control_active_' . $this->object_type . '_' . $this->id, array($this, 'customize_control_active'), 10, 2); }
/** * Constructor. * * @since 4.1.0 * @since 4.2.0 Moved from WP_Fields_API_Upload_Control. * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Optional. Arguments to override class property defaults. */ public function __construct($manager, $id, $args = array()) { parent::__construct($manager, $id, $args); $this->button_labels = array('select' => __('Select File'), 'change' => __('Change File'), 'default' => __('Default'), 'remove' => __('Remove'), 'placeholder' => __('No file selected'), 'frame_title' => __('Select File'), 'frame_button' => __('Choose File')); }
/** * Constructor. * * @uses WP_Fields_API_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Optional. Arguments to override class property defaults. */ public function __construct($manager, $id, $args = array()) { $this->statuses = array('' => __('Default')); parent::__construct($manager, $id, $args); }