storefront/inc/customizer/class-storefront-customizer-control-arbitrary.php

53 lines
928 B
PHP
Raw Normal View History

2015-01-28 16:02:14 +00:00
<?php
/**
* Class to create a custom arbitrary html control for dividers etc
*
* @package storefront
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* The arbitrary control class
2015-01-28 16:02:14 +00:00
*/
class Arbitrary_Storefront_Control extends WP_Customize_Control {
/**
* The settings var
*
* @var string $settings the blog name.
*/
2015-01-28 16:02:14 +00:00
public $settings = 'blogname';
/**
* The description var
*
* @var string $description the control description.
*/
2015-01-28 16:02:14 +00:00
public $description = '';
2016-02-19 16:57:56 +00:00
/**
* Renter the control
*
* @return void
*/
2015-01-28 16:02:14 +00:00
public function render_content() {
switch ( $this->type ) {
default:
case 'text' :
2015-03-24 10:28:45 +00:00
echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
2015-01-28 16:02:14 +00:00
break;
case 'heading':
echo '<span class="customize-control-title">' . esc_html( $this->label ) . '</span>';
break;
case 'divider' :
echo '<hr style="margin: 1em 0;" />';
break;
}
}
}