• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP WP_Customize_Image_Control类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中WP_Customize_Image_Control的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Image_Control类的具体用法?PHP WP_Customize_Image_Control怎么用?PHP WP_Customize_Image_Control使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WP_Customize_Image_Control类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  *
  * If $args['settings'] is not defined, use the $id as the setting ID.
  *
  * @uses   WP_Customize_Image_Control::__construct()
  * @param  WP_Customize_Manager $manager
  * @param  string $id
  * @param  array $args
  * @since  1.0.0
  */
 public function __construct($manager, $id, $args)
 {
     parent::__construct($manager, $id, $args);
     $this->theme = reach_get_theme();
     /**
      * Usually, this control will be instantiated during the customize_register
      * event, so if that is the current filter, call the method directly.
      */
     if (current_filter() == 'customize_register') {
         $this->customize_register($manager);
     } elseif (!did_action('customize_register')) {
         add_action('customize_register', array($this, 'customize_register'));
     } else {
         wp_die(__('Reach_Customizer_Retina_Image_Control must be instantiated before or during the customize_register action.', 'reach'));
     }
     add_action('customize_save', array($this, 'customize_save'));
     add_action('customize_save_after', array($this, 'customize_save_after'));
 }
开发者ID:Charitable,项目名称:Reach,代码行数:29,代码来源:class-reach-customizer-retina-image-control.php


示例2: __construct

 /**
  * Constructor.
  *
  * @since 3.4.0
  * @uses WP_Customize_Image_Control::__construct()
  *
  * @param WP_Customize_Manager $manager
  */
 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
 }
开发者ID:jermbo,项目名称:allTests,代码行数:12,代码来源:wp-customize-image-reloaded.php


示例3: __construct

 /**
  * Constructor.
  *
  * @since 3.4.0
  * @uses WP_Customize_Image_Control::__construct()
  * @uses WP_Customize_Image_Control::add_tab()
  *
  * @param WP_Customize_Manager $manager
  */
 public function __construct($manager)
 {
     parent::__construct($manager, 'header_image', array('label' => __('Header Image'), 'settings' => array('default' => 'header_image', 'data' => 'header_image_data'), 'section' => 'header_image', 'context' => 'custom-header', 'removed' => 'remove-header', 'get_url' => 'get_header_image', 'statuses' => array('' => __('Default'), 'remove-header' => __('No Image'), 'random-default-image' => __('Random Default Image'), 'random-uploaded-image' => __('Random Uploaded Image'))));
     $this->add_tab('default', __('Default'), array($this, 'tab_default_headers'));
 }
开发者ID:netcon-source,项目名称:WordPress,代码行数:14,代码来源:class-wp-customize-control.php


示例4: enqueue

 /**
  * This function enqueues scripts and styles
  */
 public function enqueue()
 {
     wp_enqueue_media();
     // Enqueue media scripts
     wp_enqueue_script('sds-theme-options-customizer-logo', get_template_directory_uri() . '/includes/js/customizer-sds-theme-options-logo.js', array('customize-base', 'customize-controls'), SDS_Theme_Options::VERSION);
     // Call the parent enqueue method here
     parent::enqueue();
 }
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:11,代码来源:class-sds-theme-options-customize-logo-control.php


示例5: to_json

 /**
  * Refresh the parameters passed to the JavaScript via JSON.
  *
  * @since 4.3.0
  * @access public
  *
  * @see WP_Customize_Control::to_json()
  */
 public function to_json()
 {
     parent::to_json();
     $this->json['width'] = absint($this->width);
     $this->json['height'] = absint($this->height);
     $this->json['flex_width'] = absint($this->flex_width);
     $this->json['flex_height'] = absint($this->flex_height);
 }
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:16,代码来源:class-wp-customize-cropped-image-control.php


示例6: enqueue

 /**
  * @access public
  */
 public function enqueue()
 {
     wp_enqueue_media();
     wp_enqueue_script('customize-views');
     $this->prepare_control();
     wp_localize_script('customize-views', '_wpCustomizeHeader', array('data' => array('width' => absint(get_theme_support('custom-header', 'width')), 'height' => absint(get_theme_support('custom-header', 'height')), 'flex-width' => absint(get_theme_support('custom-header', 'flex-width')), 'flex-height' => absint(get_theme_support('custom-header', 'flex-height')), 'currentImgSrc' => $this->get_current_image_src()), 'nonces' => array('add' => wp_create_nonce('header-add'), 'remove' => wp_create_nonce('header-remove')), 'uploads' => $this->uploaded_headers, 'defaults' => $this->default_headers));
     parent::enqueue();
 }
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:11,代码来源:class-wp-customize-header-image-control.php


示例7: enqueue

 /**
  * This function enqueues scripts and styles
  */
 public function enqueue()
 {
     wp_enqueue_media();
     // Enqueue media scripts
     wp_enqueue_script('sds-theme-options-customizer-logo', SDS_Theme_Options::sds_core_url() . '/js/customizer-sds-theme-options-logo.js', array('customize-base', 'customize-controls'), SDS_Theme_Options::get_version());
     // Call the parent enqueue method here
     parent::enqueue();
 }
开发者ID:sdsweb,项目名称:baton,代码行数:11,代码来源:class-sds-theme-options-customize-logo-control.php


示例8: __construct

 /**
  * 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)
 {
     $this->statuses = array('' => __('No Image', ''));
     parent::__construct($manager, $id, $args);
     $this->add_tab('upload-new', __('Upload New', 'Theme Name'), array($this, 'tab_upload_new'));
     $this->add_tab('uploaded', __('Uploaded', 'Theme Name'), array($this, 'tab_uploaded'));
     // Early priority to occur before $this->manager->prepare_controls();
     add_action('customize_controls_init', array($this, 'prepare_control'), 5);
 }
开发者ID:ericdebelak,项目名称:starter-theme,代码行数:21,代码来源:customize.php


示例9: __construct

 /**
  * Create a new Voce Image Control
  */
 public function __construct($manager, $id, $args)
 {
     parent::__construct($manager, $id, $args);
     $output_formats = array('src', 'id');
     $this->output_format = 'src';
     if (!empty($args['output_format']) && in_array($args['output_format'], $output_formats)) {
         $this->output_format = $args['output_format'];
     }
     $this->remove_tab('upload-new');
     $this->remove_tab('uploaded');
 }
开发者ID:voceconnect,项目名称:voce-theme-customizer,代码行数:14,代码来源:Voce_Customize_Image_Control.php


示例10: __construct

 /**
  * 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)
 {
     $this->statuses = array('' => __('No Image', 'tc-profiles'));
     parent::__construct($manager, $id, $args);
     $this->add_tab('upload-new', __('Upload New', 'tc-profiles'), array($this, 'tab_upload_new'));
     $this->add_tab('uploaded', __('Uploaded', 'tc-profiles'), array($this, 'tab_uploaded'));
     if ($this->setting->default) {
         $this->add_tab('default', __('Default', 'tc-profiles'), array($this, 'tab_default_background'));
     }
     // Early priority to occur before $this->manager->prepare_controls();
     add_action('customize_controls_init', array($this, 'prepare_control'), 5);
 }
开发者ID:Trinitycodes,项目名称:tc-profiles,代码行数:24,代码来源:customizer.php


示例11: prepare_control

 /**
  * Prepares the control.
  *
  * If no tabs exist, removes the control from the manager.
  *
  * @since 3.4.2
  */
 public function prepare_control()
 {
     global $custom_image_header;
     if (empty($custom_image_header)) {
         return parent::prepare_control();
     }
     // Process default headers and uploaded headers.
     $custom_image_header->process_default_headers();
     $this->default_headers = $custom_image_header->default_headers;
     $this->uploaded_headers = get_uploaded_header_images();
     if ($this->default_headers) {
         $this->add_tab('default', __('Default'), array($this, 'tab_default_headers'));
     }
     if (!$this->uploaded_headers) {
         $this->remove_tab('uploaded');
     }
     return parent::prepare_control();
 }
开发者ID:jcsilkey,项目名称:CodeReviewSecurityRepo,代码行数:25,代码来源:class-wp-customize-control.php


示例12: __construct

 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     $this->remove_tab('uploaded');
     $this->add_tab('medialibrary', __('Media Library'), array($this, 'tab_medialibrary'));
 }
开发者ID:dauidus,项目名称:woof,代码行数:6,代码来源:customizer.php


示例13: __construct

 public function __construct($manager, $id, $args = array())
 {
     parent::__construct($manager, $id, $args);
     $this->add_tab('medialibrary', esc_attr__('Media Library', 'converio'), array($this, 'tab_medialibrary'));
 }
开发者ID:javalidigital,项目名称:tecnigrav,代码行数:5,代码来源:customize.php


示例14: __construct

 public function __construct($manager, $id, $args)
 {
     parent::__construct($manager, $id, $args);
     $this->add_tab('tab_defaults', 'default', array($this, 'tab_defaults'));
 }
开发者ID:Om3rCitak,项目名称:Kotetsu,代码行数:5,代码来源:kotetsu-logo-control.php


示例15: __construct

 public function __construct($manager, $id, $args)
 {
     $this->get_url = array($this, 'get_img_url');
     if (!empty($id)) {
         $this->context = $id;
     }
     parent::__construct($manager, $id, $args);
 }
开发者ID:datalynk,项目名称:quizzlestick,代码行数:8,代码来源:icit-custom-controls.php


示例16: enqueue

 /**
  * Enqueue control related scripts/styles.
  *
  * @since 4.1.0
  */
 public function enqueue()
 {
     parent::enqueue();
     $custom_background = get_theme_support('custom-background');
     wp_localize_script('customize-controls', '_wpCustomizeBackground', array('defaults' => !empty($custom_background[0]) ? $custom_background[0] : array(), 'nonces' => array('add' => wp_create_nonce('background-add'))));
 }
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:11,代码来源:class-wp-customize-background-image-control.php


示例17: enqueue

 /**
  * Enqueue control related scripts/styles.
  *
  * @since 4.1.0
  */
 public function enqueue()
 {
     parent::enqueue();
     wp_localize_script('customize-controls', '_wpCustomizeBackground', array('nonces' => array('add' => wp_create_nonce('background-add'))));
 }
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:10,代码来源:class-wp-customize-background-image-control.php


示例18: __construct

 /**
  * Constructor.
  *
  * @since 4.5.0
  * @access public
  *
  * @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 logo'), 'change' => __('Change logo'), 'remove' => __('Remove'), 'default' => __('Default'), 'placeholder' => __('No logo selected'), 'frame_title' => __('Select logo'), 'frame_button' => __('Choose logo'));
 }
开发者ID:yaoyonstudio,项目名称:WordPress,代码行数:15,代码来源:class-wp-customize-site-logo-control.php


示例19: __construct

 public function __construct($manager)
 {
     parent::__construct($manager, 'digitalstore_theme_options[logo_image]', array('label' => __('Logo Image'), 'section' => 'strings', 'context' => 'custom-logo-image', 'removed' => 'removed', 'statuses' => array('' => __('No Image', 'edd-digitalstore'), 'removed' => __('Removed', 'edd-digitalstore'))));
 }
开发者ID:SelaInc,项目名称:Digital-Store,代码行数:4,代码来源:class-wp-customize-controls.php


示例20: __construct

 public function __construct($manager, $id, $args)
 {
     $this->get_url = array($this, 'get_img_url');
     parent::__construct($manager, $id, $args);
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:5,代码来源:testimonial.php



注:本文中的WP_Customize_Image_Control类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WP_Customize_Manager类代码示例发布时间:2022-05-23
下一篇:
PHP WP_Customize_Control类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap