| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Template_Code extends WPUPG_Template_Block { |
| 4 |
|
| 5 |
public $text; |
| 6 |
|
| 7 |
public $editorField = 'code'; |
| 8 |
|
| 9 |
public function __construct( $type = 'code' ) |
| 10 |
{ |
| 11 |
parent::__construct( $type ); |
| 12 |
} |
| 13 |
|
| 14 |
public function text( $text ) |
| 15 |
{ |
| 16 |
$this->text = $text; |
| 17 |
return $this; |
| 18 |
} |
| 19 |
|
| 20 |
public function output( $post, $args = array() ) |
| 21 |
{ |
| 22 |
if( !$this->output_block( $post, $args ) ) return ''; |
| 23 |
|
| 24 |
$output = $this->before_output(); |
| 25 |
|
| 26 |
$text = do_shortcode( $this->text ); |
| 27 |
|
| 28 |
$output .= '<span' . $this->style() . '>' . $text . '</span>'; |
| 29 |
|
| 30 |
return $this->after_output( $output, $post ); |
| 31 |
} |
| 32 |
} |