__construct() 공개 메소드

Supplied $args override class property defaults. If $args['settings'] is not defined, use the $id as the setting ID.
부터: 3.4.0
public __construct ( WP_Customize_Manager $manager, string $id, array $args = [] )
$manager WP_Customize_Manager Customizer bootstrap instance.
$id string Control ID.
$args array { Optional. Arguments to override class property defaults. @type int $instance_number Order in which this instance was created in relation to other instances. @type WP_Customize_Manager $manager Customizer bootstrap instance. @type string $id Control ID. @type array $settings All settings tied to the control. If undefined, `$id` will be used. @type string $setting The primary setting for the control (if there is one). Default 'default'. @type int $priority Order priority to load the control. Default 10. @type string $section Section the control belongs to. Default empty. @type string $label Label for the control. Default empty. @type string $description Description for the control. Default empty. @type array $choices List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. Default empty array. @type array $input_attrs List of custom input attributes for control output, where attribute names are the keys and values are the values. Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. Default empty array. @type array $json Deprecated. Use WP_Customize_Control::json() instead. @type string $type Control type. Core controls include 'text', 'checkbox', 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional input types such as 'email', 'url', 'number', 'hidden', and 'date' are supported implicitly. Default 'text'. }
 /**
  * Constructor.
  *
  * @since 4.1.0
  * @since 4.2.0 Moved from WP_Customize_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);
     if (!$this instanceof WP_Customize_Image_Control) {
         $this->button_labels = wp_parse_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 for our custom control.
  *
  * @param object $wp_customize
  * @param string $control_id
  * @param array $args
  * @uses Site_Logo_Image_Control::l10n()
  */
 public function __construct($wp_customize, $control_id, $args = array())
 {
     // declare these first so they can be overridden
     $this->l10n = array('upload' => __('Add logo', 'layerswp'), 'set' => __('Set as logo', 'layerswp'), 'choose' => __('Choose logo', 'layerswp'), 'change' => __('Change logo', 'layerswp'), 'remove' => __('Remove logo', 'layerswp'), 'placeholder' => __('No logo set', 'layerswp'));
     $this->directory_uri = LAYERS_TEMPLATE_URI . '/core/third-party/site-logo/';
     parent::__construct($wp_customize, $control_id, $args);
 }
예제 #3
0
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if (!empty($args['llorix_one_lite_message'])) {
         $this->message = $args['llorix_one_lite_message'];
     }
 }
 /**
  * This function sets up all of the actions and filters on instance. It also loads (includes)
  * the required files and assets.
  */
 function __construct($manager, $id, $args = array())
 {
     // Hooks
     // TODO
     // Call the parent constructor here
     parent::__construct($manager, $id, $args);
 }
 /**
  * Set up our control.
  *
  * @since  1.0.0
  * @access public
  * @param  object  $manager
  * @param  string  $id
  * @param  array   $args
  * @return void
  */
 public function __construct($manager, $id, $args = array())
 {
     // Let the parent class do its thing.
     parent::__construct($manager, $id, $args);
     // Make sure we have labels.
     $this->l10n = wp_parse_args($this->l10n, array('family' => esc_html__('Font Family', 'ctypo'), 'size' => esc_html__('Font Size', 'ctypo'), 'weight' => esc_html__('Font Weight', 'ctypo'), 'style' => esc_html__('Font Style', 'ctypo'), 'line_height' => esc_html__('Line Height', 'ctypo')));
 }
예제 #6
0
 /**
  * Constructor.
  *
  * @since 3.4.0
  * @uses WP_Customize_Control::__construct()
  *
  * @param WP_Customize_Manager $manager
  * @param string $id
  * @param array $args
  */
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if (!empty($args['choices'])) {
         $this->colours = $args['choices'];
     }
 }
예제 #7
0
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if ($this->font_set_filter) {
         $this->font_set = apply_filters($this->font_set_filter, $this->font_set, $this->id);
     }
 }
예제 #8
0
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if (!empty($args['parallax_message'])) {
         $this->message = $args['parallax_message'];
     }
 }
 public function __construct($manager, $id, $args = array())
 {
     if (isset($args['taxonomy']) && in_array($args['taxonomy'], get_taxonomies())) {
         $this->taxonomy = $args['taxonomy'];
     }
     parent::__construct($manager, $id, $args);
 }
예제 #10
0
 public function __construct($manager, $id, $args = array())
 {
     $this->statuses = array('' => __('Default', 'doctors'));
     parent::__construct($manager, $id, $args);
     if (tally_config('type') == 'none' && $this->css_class == 'biz' || tally_config('type') == 'away' && $this->css_class == 'hbiz' || tally_config('type') == 'none' && $this->css_class == 'hbiz') {
         $this->type = 's';
     }
 }
 public function __construct($manager, $id, $args = array())
 {
     $_opt_prefix = TC_wfc::$instance->plug_option_prefix;
     $this->customs = get_option("{$_opt_prefix}_customs_" . TC_wfc::$theme_name);
     $this->lang_domain = TC_wfc::$instance->plug_lang;
     $this->selector_settings = TC_wfc::$instance->tc_get_selector_list();
     parent::__construct($manager, $id, $args);
 }
 public function __construct($wp_customize, $id, $args, $field)
 {
     if (isset($args['type'])) {
         $args['type'] = 'wpdlib_' . $args['type'];
     }
     parent::__construct($wp_customize, $id, $args);
     $this->_field = $field;
 }
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if (empty($args['psu_args']) || !is_array($args['psu_args'])) {
         $args['psu_args'] = array();
     }
     $this->psu_args = $args['psu_args'];
 }
예제 #14
0
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     $this->section = $args['element']['section'];
     $this->label = isset($args['element']['title']) ? $args['element']['title'] : "";
     $this->description = isset($args['element']['description']) ? $args['element']['description'] : '';
     $this->type = $args['element']['type'];
     $this->element['custom_attrs'] = array();
 }
예제 #15
0
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     $this->choices = array();
     $post_types = \Morepress\Post_Type::find(array(), 'object');
     foreach ($post_types as $key => $item) {
         $this->choices[$key] = $item->labels->name;
     }
 }
예제 #16
0
 public function __construct($manager, $id, $args = array(), $options = array())
 {
     $this->fonts = get_transient('google_font_names_');
     if (!is_array($this->fonts)) {
         $this->fonts = $this->get_font_names();
     }
     if (!$this->fonts) {
         return;
     }
     parent::__construct($manager, $id, $args);
 }
 function __construct($manager, $id, $args = array())
 {
     $args = apply_filters('ctf_before_pass_args', $args);
     parent::__construct($manager, $id, $args);
     $this->type = isset($args['type']) && !empty($args['type']) ? 'ctf_' . $args['type'] : 'ctf_text';
     $this->field_type = isset($args['type']) && !empty($args['type']) ? $args['type'] : 'text';
     $this->description = isset($args['description']) && !empty($args['description']) ? $args['description'] : '';
     $this->subtitle = isset($args['subtitle']) && !empty($args['subtitle']) ? $args['subtitle'] : '';
     $this->choices = isset($args['choices']) && !empty($args['choices']) ? $args['choices'] : '';
     $this->id = $id;
 }
 /**
  * Constructor
  */
 function __construct($manager, $id, $args)
 {
     // i18n
     $this->checked_label = __('Show', 'baton');
     $this->unchecked_label = __('Hide', 'baton');
     // Actions/ Filters
     add_action('customize_controls_print_styles', array($this, 'customize_controls_print_styles'));
     // Output styles in the Customizer
     // Call the parent constructor here
     parent::__construct($manager, $id, $args);
 }
예제 #19
0
 public function __construct($manager, $id, $args = array(), $config = array(), $container = null)
 {
     parent::__construct($manager, $id, $args);
     $this->config = $config;
     $this->container = $container;
     $this->type = 'woodlets-' . $config['type'];
     $this->fieldTypeManager = $this->container['fieldTypeManager'];
     $fieldType = $this->fieldTypeManager->getFieldType($config['type']);
     if ($fieldType) {
         $fieldType->prepare();
     }
 }
 /**
  * Constructor Function
  * 
  * Sets up the variables for this class
  * instance.
  *
  * @since 1.3.4
  * @version 1.3.7
  * 
  */
 function __construct($manager, $id, $args = array())
 {
     $this->plugin_slug = 'easy-google-fonts';
     $this->manager = $manager;
     $this->id = $id;
     $this->args = $args;
     // Call WP_Customize_Control parent constuctor.
     parent::__construct($this->manager, $this->id, $this->args);
     // Define tabs for this font control.
     $this->add_tab('font-styles', __('Styles', 'easy-google-fonts'), array($this, 'get_style_controls'), true);
     $this->add_tab('font-appearance', __('Appearance', 'easy-google-fonts'), array($this, 'get_appearance_controls'));
     $this->add_tab('font-positioning', __('Positioning', 'easy-google-fonts'), array($this, 'get_positioning_controls'));
 }
예제 #21
0
 public function __construct($manager, $id, $args = array())
 {
     $our_taxonomy = 'category';
     if (isset($args['taxonomy'])) {
         $taxonomy_exist = taxonomy_exists(esc_attr($args['taxonomy']));
         if (true === $taxonomy_exist) {
             $our_taxonomy = esc_attr($args['taxonomy']);
         }
     }
     $args['taxonomy'] = $our_taxonomy;
     $this->taxonomy = esc_attr($our_taxonomy);
     parent::__construct($manager, $id, $args);
 }
	/**
	 * Constructor for our custom control.
	 *
	 * @param object $wp_customize
	 * @param string $control_id
	 * @param array $args
	 * @uses Site_Logo_Image_Control::l10n()
	 */
	public function __construct( $wp_customize, $control_id, $args = array() ) {
		// declare these first so they can be overridden
		$this->l10n = array(
			'upload' =>      __( 'Add logo', 'jetpack' ),
			'set' =>         __( 'Set as logo', 'jetpack' ),
			'choose' =>      __( 'Choose logo', 'jetpack' ),
			'change' =>      __( 'Change logo', 'jetpack' ),
			'remove' =>      __( 'Remove logo', 'jetpack' ),
			'placeholder' => __( 'No logo set', 'jetpack' ),
		);

		parent::__construct( $wp_customize, $control_id, $args );
	}
예제 #23
0
 public function __construct($page, $field, $wp_customize = null, $alias = null, $params = null)
 {
     $this->page = $page;
     $this->field = $field;
     if ($wp_customize) {
         $this->is_customize_theme_page = true;
         parent::__construct($wp_customize, $alias, $params);
     } else {
         $this->is_customize_theme_page = false;
     }
     if (method_exists($this, 'assign_handlers')) {
         $this->assign_handlers();
     }
 }
 /**
  * Constructor.
  *
  * If $args['settings'] is not defined, use the $id as the setting ID.
  *
  * @since 3.4.0
  * @uses WP_Customize_Upload_Control::__construct()
  *
  * @param WP_Customize_Manager $manager
  * @param string $id
  * @param array $args
  */
 public function __construct($manager, $id, $args = array())
 {
     // Set option name, properties and default values
     $this->option_name = "tt_font_theme_options[{$id}]";
     $this->option = $args['option'];
     $this->font_properties = $args['option']['properties'];
     $this->font_defaults = $args['option']['default'];
     // Set variables
     $this->selector = $args['option']['properties']['selector'];
     $this->force_styles = $args['option']['properties']['force_styles'];
     parent::__construct($manager, $id, $args);
     $this->add_tab('font-styles', __('Styles', 'easy-google-fonts'), array($this, 'get_style_controls'), true);
     $this->add_tab('font-appearance', __('Appearance', 'easy-google-fonts'), array($this, 'get_appearance_controls'));
     $this->add_tab('font-positioning', __('Positioning', 'easy-google-fonts'), array($this, 'get_positioning_controls'));
 }
 /**
  * Initialize
  *
  * @since 0.1
  */
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     // To render the control templates, the customizer manager creates
     // a fake instantiation of each control with an id of `temp` and
     // then calls print_template on it. As a result, any hooks added in
     // the construct function will be hooked twice.
     if ($this->id == 'temp') {
         return;
     }
     add_action('customize_controls_enqueue_scripts', array($this, 'enqueue_control_assets'));
     add_action('customize_controls_print_footer_scripts', array($this, 'add_component_templates'));
     add_action('customize_preview_init', array($this, 'enqueue_preview_assets'));
     add_action('customize_update_content_layout', array($this, 'save_to_post_content'), 10, 2);
     add_action('customize_preview_init', array($this, 'filter_preview_content'));
 }
예제 #26
0
 function __construct($manager, $id, $args = array())
 {
     // Let other themes and plugins process the web fonts array
     $google_web_fonts = (include dirname(__FILE__) . '/google-fonts.php');
     // Add the default fonts
     $choices = array('Helvetica Neue' => 'Helvetica Neue', 'Lucida Grande' => 'Lucida Grande', 'Arial' => 'Arial', 'Verdana' => 'Verdana', 'Georgia' => 'Georgia', 'Courier New' => 'Courier New');
     foreach ($google_web_fonts as $font => $variants) {
         foreach ($variants as $variant) {
             if ($variant == 'regular' || $variant == 400) {
                 $choices[$font] = $font;
             } else {
                 $choices[$font . ':' . $variant] = $font . ' (' . $variant . ')';
             }
         }
     }
     $args = wp_parse_args($args, array('type' => 'select', 'choices' => $choices));
     parent::__construct($manager, $id, $args);
 }
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     if (empty($this->button_label)) {
         $this->button_label = __('Add new row', 'Kirki');
     }
     if (empty($args['fields']) || !is_array($args['fields'])) {
         $args['fields'] = array();
     }
     foreach ($args['fields'] as $key => $value) {
         if (!isset($value['default'])) {
             $args['fields'][$key]['default'] = '';
         }
         if (!isset($value['label'])) {
             $args['fields'][$key]['label'] = '';
         }
         $args['fields'][$key]['id'] = $key;
     }
     $this->fields = $args['fields'];
 }
 public function __construct($manager, $id, $args = array(), $options = "", $field)
 {
     $this->options = $options;
     $this->field = $field;
     parent::__construct($manager, $id, $args);
 }
예제 #29
0
 public function __construct($manager, $id, $args = array())
 {
     $this->args = $args;
     $this->field_id = $id;
     parent::__construct($manager, $id, $args);
 }
예제 #30
0
 public function __construct($manager, $id, $args = array(), $options = array())
 {
     $this->cats = get_categories($options);
     parent::__construct($manager, $id, $args);
 }