本文整理汇总了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>";
}
示例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
//.........这里部分代码省略.........
示例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
//.........这里部分代码省略.........