| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Template_Box extends WPUPG_Template_Block { |
| 4 |
|
| 5 |
public $editorField = 'box'; |
| 6 |
|
| 7 |
public function __construct( $type = 'box' ) |
| 8 |
{ |
| 9 |
parent::__construct( $type ); |
| 10 |
} |
| 11 |
|
| 12 |
public function output( $post, $args = array() ) |
| 13 |
{ |
| 14 |
if( !$this->output_block( $post, $args ) ) return ''; |
| 15 |
|
| 16 |
$args['max_width'] = $this->max_width && $args['max_width'] > $this->max_width ? $this->max_width : $args['max_width']; |
| 17 |
$args['max_height'] = $this->max_height && $args['max_height'] > $this->max_height ? $this->max_height : $args['max_height']; |
| 18 |
$args['desktop'] = $args['desktop'] && $this->show_on_desktop; |
| 19 |
$output = $this->before_output(); |
| 20 |
|
| 21 |
ob_start(); |
| 22 |
?> |
| 23 |
<span<?php echo $this->style(); ?>> |
| 24 |
<?php $this->output_children( $post, 0, 0, $args ) ?> |
| 25 |
</span> |
| 26 |
<?php |
| 27 |
$output .= ob_get_contents(); |
| 28 |
ob_end_clean(); |
| 29 |
|
| 30 |
return $this->after_output( $output, $post ); |
| 31 |
} |
| 32 |
} |