当前位置: 首页>>代码示例>>PHP>>正文


PHP WP_Customize_Manager::remove_panel方法代码示例

本文整理汇总了PHP中WP_Customize_Manager::remove_panel方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Manager::remove_panel方法的具体用法?PHP WP_Customize_Manager::remove_panel怎么用?PHP WP_Customize_Manager::remove_panel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WP_Customize_Manager的用法示例。


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

示例1: _unregister_core_ui

 /**
  * Removes all non-AMP sections and panels.
  *
  * Provides a clean, standalone instance-like experience by removing all non-AMP registered panels and sections.
  *
  * @since 0.4
  * @access private
  */
 private function _unregister_core_ui()
 {
     $panels = $this->wp_customize->panels();
     $sections = $this->wp_customize->sections();
     foreach ($panels as $panel_id => $object) {
         $this->wp_customize->remove_panel($panel_id);
     }
     foreach ($sections as $section_id => $object) {
         $this->wp_customize->remove_section($section_id);
     }
 }
开发者ID:thenextweb,项目名称:amp-wp,代码行数:19,代码来源:class-amp-customizer.php

示例2: setPanel

 /**
  * Handle a panel entry
  *
  * @param $id
  * @param array $data
  * @param array|null $sections
  */
 public function setPanel($id, array $data, array $sections = null)
 {
     $panel_data = $this->getPanelData($data);
     if (is_null($sections) && isset($data['sections'])) {
         $sections = $data['sections'];
     }
     $item = $this->customizer->get_panel($id);
     if ($item) {
         foreach ($data as $var => $val) {
             if (array_key_exists($var, $panel_data)) {
                 $item->{$var} = $val;
             }
         }
         if (isset($data['delete']) && $data['delete'] === true) {
             $this->customizer->remove_panel($id);
         }
     } else {
         $this->customizer->add_panel(new WP_Customize_Panel($this->customizer, $id, $panel_data));
     }
     if (!is_null($sections)) {
         $sections['object'] = 'sections';
         $sections['panel'] = $id;
         $this->processData($sections);
     }
 }
开发者ID:e-picas,项目名称:wp-basic-bootstrap,代码行数:32,代码来源:WP_Basic_Bootstrap_Customizer_Abstract.php

示例3: supermag_customize_register

/**
 * Adding different options
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function supermag_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    /*saved options*/
    $options = supermag_get_theme_options();
    /*defaults options*/
    $defaults = supermag_get_default_theme_options();
    /*
     * file for customizer custom controls classes
     */
    $supermag_custom_controls_file_path = supermag_file_directory('acmethemes/customizer/custom-controls.php');
    require $supermag_custom_controls_file_path;
    /*
     * file for feature panel of home page
     */
    $supermag_customizer_feature_option_file_path = supermag_file_directory('acmethemes/customizer/feature-section/feature-panel.php');
    require $supermag_customizer_feature_option_file_path;
    /*
     * file for header panel
     */
    $supermag_customizer_header_options_file_path = supermag_file_directory('acmethemes/customizer/header-options/header-panel.php');
    require $supermag_customizer_header_options_file_path;
    /*
     * file for customizer footer section
     */
    $supermag_customizer_footer_options_file_path = supermag_file_directory('acmethemes/customizer/footer-section/footer-section.php');
    require $supermag_customizer_footer_options_file_path;
    /*
     * file for design/layout panel
     */
    $supermag_customizer_design_options_file_path = supermag_file_directory('acmethemes/customizer/design-options/design-panel.php');
    require $supermag_customizer_design_options_file_path;
    /*
     * file for single post sections
     */
    $supermag_customizer_single_post_section_file_path = supermag_file_directory('acmethemes/customizer/single-posts/single-post-section.php');
    require $supermag_customizer_single_post_section_file_path;
    /*
     * file for options panel
     */
    $supermag_customizer_options_panel_file_path = supermag_file_directory('acmethemes/customizer/options/options-panel.php');
    require $supermag_customizer_options_panel_file_path;
    /*
     * file for options reset
     */
    $supermag_customizer_options_reset_file_path = supermag_file_directory('acmethemes/customizer/options/options-reset.php');
    require $supermag_customizer_options_reset_file_path;
    /*removing*/
    $wp_customize->remove_panel('header_image');
    $wp_customize->remove_control('header_textcolor');
}
开发者ID:idea-lab,项目名称:Spectrum,代码行数:57,代码来源:customizer.php

示例4: customize_register

 public function customize_register(WP_Customize_Manager $customizeManager)
 {
     // this field will be checked in settings method
     PP_Customizer_Customizer()->settings->customizeManager = $customizeManager;
     $settings = PP_Customizer_Customizer()->settings->get_settings();
     foreach ($settings as $sectionID => $isEnabled) {
         if ($isEnabled == 'false') {
             $panel = $customizeManager->get_panel($sectionID);
             if (isset($panel) && $panel != null) {
                 // is a panel, remove it
                 $customizeManager->remove_panel($sectionID);
             } else {
                 $customizeManager->remove_section($sectionID);
             }
         }
     }
 }
开发者ID:MrMuzik,项目名称:ar4tupgrade,代码行数:17,代码来源:class-pp-customizer-customizer-admin.php

示例5: responsiveboat_customize_register

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function responsiveboat_customize_register($wp_customize)
{
    /* Remove About us section */
    $wp_customize->remove_panel('panel_about');
    $wp_customize->remove_section('zerif_aboutus_settings_section');
    $wp_customize->remove_section('zerif_aboutus_main_section');
    $wp_customize->remove_section('zerif_aboutus_feat1_section');
    $wp_customize->remove_section('zerif_aboutus_feat2_section');
    $wp_customize->remove_section('zerif_aboutus_feat3_section');
    $wp_customize->remove_section('zerif_aboutus_feat4_section');
    $wp_customize->remove_section('zerif_aboutus_clients_section');
    $wp_customize->remove_section('zerif_contactus_section');
    /**************************************/
    /********** Big title image **********/
    /*************************************/
    $wp_customize->add_setting('rb_bigtitle_logo', array('sanitize_callback' => 'esc_url_raw', 'default' => get_stylesheet_directory_uri() . '/images/logo-small.png'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'rb_bigtitle_logo', array('label' => __('Header Logo', 'responsiveboat'), 'section' => 'zerif_bigtitle_section', 'priority' => 7)));
    /**************************************/
    /********   About me section *********/
    /*************************************/
    $wp_customize->add_section('rb_aboutyou_section', array('title' => __('About you section', 'responsiveboat'), 'priority' => 34));
    /* about you show/hide */
    $wp_customize->add_setting('rb_aboutyou_show', array('sanitize_callback' => 'responsiveboat_sanitize_text'));
    $wp_customize->add_control('rb_aboutyou_show', array('type' => 'checkbox', 'label' => __('Hide about you section?', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 1));
    /* title */
    $wp_customize->add_setting('rb_aboutyou_title', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('About you', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_title', array('label' => __('Title', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 2));
    /* subtitle */
    $wp_customize->add_setting('rb_aboutyou_subtitle', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('Use this section to showcase important details about you.', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_subtitle', array('label' => __('Subtitle', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 3));
    /* text */
    $wp_customize->add_setting('rb_aboutyou_text', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec massa enim. Aliquam viverra at est ullamcorper sollicitudin. Proin a leo sit amet nunc malesuada imperdiet pharetra ut eros.<br><br> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec massa enim. Aliquam viverra at est ullamcorper sollicitudin. Proin a leo sit amet nunc malesuada imperdiet pharetra ut eros. <br><br>Mauris vel nunc at ipsum fermentum pellentesque quis ut massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas non adipiscing massa. Sed ut fringilla sapien. Cras sollicitudin, lectus sed tincidunt cursus, magna lectus vehicula augue, a lobortis dui orci et est.', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_text', array('label' => __('Text', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 4));
    /* image */
    $wp_customize->add_setting('rb_aboutyou_image', array('sanitize_callback' => 'esc_url_raw', 'default' => get_stylesheet_directory_uri() . '/images/about.jpg'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'rb_aboutyou_image', array('label' => __('Image', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 5)));
}
开发者ID:baxri,项目名称:wordpress,代码行数:42,代码来源:customizer.php

示例6: klean_customize_register

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function klean_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->remove_section('nav');
    $wp_customize->remove_panel('widgets');
    $wp_customize->add_setting('logo', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('OR Logo Upload', 'klean'), 'section' => 'title_tagline', 'settings' => 'logo')));
    $wp_customize->add_section('klean_layout', array('title' => __('Layout Settings', 'klean'), 'description' => __('Manage the Layout Settings of your site.', 'klean'), 'priority' => 1));
    $wp_customize->add_setting('klean-post-sidebar', array('default' => false, 'sanitize_callback' => 'klean_sanitize_checkbox'));
    $wp_customize->add_control('klean-post-sidebar', array('type' => 'checkbox', 'label' => __('Hide Sidebar on Posts/Pages', 'klean'), 'section' => 'klean_layout', 'priority' => 1));
    $wp_customize->add_section('klean_social', array('title' => __('Social Settings', 'klean'), 'description' => __('Manage the Social Icon Setings of your site.', 'klean'), 'priority' => 3));
    $wp_customize->add_setting('social', array('default' => false, 'sanitize_callback' => 'klean_sanitize_checkbox'));
    $wp_customize->add_control('social', array('type' => 'checkbox', 'label' => __('Enable Social Icons', 'klean'), 'section' => 'klean_social', 'priority' => 1));
    $wp_customize->add_setting('klean-social-color', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'klean-social-color', array('label' => __('Background of the Social Icons', 'klean'), 'section' => 'klean_social', 'settings' => 'klean-social-color')));
    $wp_customize->add_setting('klean-social-icon-color', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'klean-social-icon-color', array('label' => __('Color of the Social Icons', 'klean'), 'section' => 'klean_social', 'settings' => 'klean-social-icon-color')));
    $wp_customize->add_setting('facebook', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('facebook', array('label' => __('Facebook URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('twitter', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('twitter', array('label' => __('Twitter URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('google-plus', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('google-plus', array('label' => __('Google Plus URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('instagram', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('instagram', array('label' => __('Instagram URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('pinterest-p', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('pinterest-p', array('label' => __('Pinterest URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('youtube', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('youtube', array('label' => __('Youtube URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('linkedin', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('linkedin', array('label' => __('Linked-In URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('vimeo-square', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('vimeo-square', array('label' => __('Vimeo URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('envelope-o', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('envelope-o', array('label' => __('Your E-Mail Info', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('tumblr', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('tumblr', array('label' => __('Tumblr URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('stumbleupon', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('stumbleupon', array('label' => __('StumbleUpon URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('reddit', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('reddit', array('label' => __('Reddit URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('vine', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('vine', array('label' => __('Vine URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('soundcloud', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('soundcloud', array('label' => __('SoundCloud URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    $wp_customize->add_setting('yelp', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('yelp', array('label' => __('Yelp URL', 'klean'), 'section' => 'klean_social', 'type' => 'text'));
    class Custom_CSS_Control extends WP_Customize_Control
    {
        public $type = 'textarea';
        public function render_content()
        {
            ?>
	            <label>
	                <span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
	                <textarea rows="8" style="width:100%;background: black; color: white;" <?php 
            $this->link();
            ?>
><?php 
            echo esc_textarea($this->value());
            ?>
</textarea>
	            </label>
	        <?php 
        }
    }
    class TextBox_Control extends WP_Customize_Control
    {
        public $type = 'textarea';
        public function render_content()
        {
            ?>
	            <label>
	                <span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
	                <textarea rows="8" style="width:100%;background: white; color: black;" <?php 
            $this->link();
            ?>
><?php 
            echo esc_textarea($this->value());
            ?>
</textarea>
	            </label>
	        <?php 
        }
    }
    $wp_customize->add_section('custom_set', array('title' => __('Custom Settings', 'klean'), 'description' => __('Add some custom CSS code to edit your theme.', 'klean'), 'priority' => 30));
    $wp_customize->add_setting('css', array('default' => '', 'sanitize_callback' => 'klean_sanitize_text'));
//.........这里部分代码省略.........
开发者ID:albertoquijano,项目名称:JesusGiles,代码行数:101,代码来源:customizer.php


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