| 1 |
<?php |
| 2 |
/** |
| 3 |
* Costumizer Shortcode control class implementation. |
| 4 |
* |
| 5 |
* @package categoryposts. |
| 6 |
* |
| 7 |
* @since 4.9 |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace categoryPosts; |
| 11 |
|
| 12 |
// Don't call the file directly. |
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Costumizer Shortcode control. |
| 19 |
* |
| 20 |
* @since 4.9 |
| 21 |
*/ |
| 22 |
class ShortCode_Control extends \WP_Customize_Control { |
| 23 |
|
| 24 |
/** |
| 25 |
* The form that should be displayed in the control. |
| 26 |
* |
| 27 |
* @var string |
| 28 |
* |
| 29 |
* @since 4.7 |
| 30 |
*/ |
| 31 |
public $form; |
| 32 |
|
| 33 |
/** |
| 34 |
* The suffix of the title to be displayed in the control (unescaped). |
| 35 |
* |
| 36 |
* @var string |
| 37 |
* |
| 38 |
* @since 4.7 |
| 39 |
*/ |
| 40 |
public $title_postfix; |
| 41 |
|
| 42 |
/** |
| 43 |
* Render the control. |
| 44 |
* |
| 45 |
* @since 4.6 |
| 46 |
*/ |
| 47 |
public function render_content() { |
| 48 |
$widget_title = 'Category Posts Shortcode' . $this->title_postfix; |
| 49 |
?> |
| 50 |
<div class="widget-top"> |
| 51 |
<div class="widget-title"><h3><?php echo esc_html( $widget_title ); ?><span class="in-widget-title"></span></h3></div> |
| 52 |
</div> |
| 53 |
<div class="widget-inside" style="display: block;"> |
| 54 |
<div class="form"> |
| 55 |
<div class="widget-content"> |
| 56 |
<?php echo $this->form; // Xss off. ?> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
<?php |
| 61 |
} |
| 62 |
} |
| 63 |
|