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