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


PHP WP_Customize_Control::render_content方法代码示例

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


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

示例1: render_content

 public function render_content()
 {
     parent::render_content();
     // echo "<p class='description'>{$this->description}</p>";
 }
开发者ID:natalieryder,项目名称:snaptactix,代码行数:5,代码来源:class-wp-customize-control.php

示例2: render_content

        protected function render_content()
        {
            switch ($this->type) {
                default:
                    return parent::render_content();
                case 'text':
                    ?>
				<label>
					<span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
					<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
					<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
					<?php 
                    }
                    ?>
					<input type="text" value="<?php 
                    echo esc_attr($this->value());
                    ?>
" <?php 
                    $this->link();
                    ?>
 />
				</label>
				<?php 
                    break;
                case 'checkbox':
                    ?>
				<label>
					<input type="checkbox" value="<?php 
                    echo esc_attr($this->value());
                    ?>
" <?php 
                    $this->link();
                    checked($this->value());
                    ?>
 />
					<?php 
                    echo esc_html($this->label);
                    ?>
				</label>
				<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
				<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
				<?php 
                    }
                    ?>
				<?php 
                    break;
                case 'radio':
                    if (empty($this->choices)) {
                        return;
                    }
                    $name = '_customize-radio-' . $this->id;
                    ?>
				<span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
				<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
				<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
				<?php 
                    }
                    ?>
				<?php 
                    foreach ($this->choices as $value => $label) {
                        ?>
					<label>
						<input type="radio" value="<?php 
                        echo esc_attr($value);
                        ?>
" name="<?php 
                        echo esc_attr($name);
                        ?>
" <?php 
                        $this->link();
                        checked($this->value(), $value);
                        ?>
 />
						<?php 
                        echo esc_html($label);
                        ?>
<br/>
					</label>
					<?php 
//.........这里部分代码省略.........
开发者ID:JeffreyBue,项目名称:jb,代码行数:101,代码来源:customizer.php

示例3: render_content

        protected function render_content()
        {
            switch ($this->type) {
                default:
                    return parent::render_content();
                case 'text':
                    ?>
				<label>
					<span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
					<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
					<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
					<?php 
                    }
                    ?>
					<input type="text" value="<?php 
                    echo esc_attr($this->value());
                    ?>
" <?php 
                    $this->link();
                    ?>
 />
				</label>
				<?php 
                    break;
                case 'radio':
                    if (empty($this->choices)) {
                        return;
                    }
                    $name = '_customize-radio-' . $this->id;
                    ?>
				<span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
				<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
				<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
				<?php 
                    }
                    ?>
				<?php 
                    foreach ($this->choices as $value => $label) {
                        ?>
					<label>
						<input type="radio" value="<?php 
                        echo esc_attr($value);
                        ?>
" name="<?php 
                        echo esc_attr($name);
                        ?>
" <?php 
                        $this->link();
                        checked($this->value(), $value);
                        ?>
 />
						<?php 
                        echo esc_html($label);
                        ?>
<br/>
					</label>
					<?php 
                    }
                    break;
                case 'select':
                    if (empty($this->choices)) {
                        return;
                    }
                    ?>
				<label>
					<span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
					<?php 
                    if (isset($this->description) && !empty($this->description)) {
                        ?>
					<span class="customize-control-description"><?php 
                        echo $this->description;
                        ?>
</span>
					<?php 
                    }
                    ?>
					<select <?php 
                    $this->link();
                    ?>
>
						<?php 
//.........这里部分代码省略.........
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:101,代码来源:customizer-functions.php


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