| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPDeveloper\BetterDocs\Shortcodes; |
| 4 |
use WPDeveloper\BetterDocs\Core\Shortcode; |
| 5 |
|
| 6 |
class Reactions extends Shortcode { |
| 7 |
public $view_wrapper = 'betterdocs-article-reactions'; |
| 8 |
|
| 9 |
public function get_name() { |
| 10 |
return 'betterdocs_article_reactions'; |
| 11 |
} |
| 12 |
|
| 13 |
public function get_style_depends() { |
| 14 |
return ['betterdocs-reactions']; |
| 15 |
} |
| 16 |
|
| 17 |
public function get_script_depends() { |
| 18 |
return ['betterdocs-reactions']; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Summary of default_attributes |
| 23 |
* @return array |
| 24 |
*/ |
| 25 |
public function default_attributes() { |
| 26 |
return [ |
| 27 |
'text' => '' |
| 28 |
]; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Summary of render |
| 33 |
* |
| 34 |
* @param mixed $atts |
| 35 |
* @param mixed $content |
| 36 |
* @return mixed |
| 37 |
*/ |
| 38 |
public function render( $atts, $content = null ) { |
| 39 |
$this->views( 'widgets/reactions' ); |
| 40 |
} |
| 41 |
|
| 42 |
public function view_params() { |
| 43 |
$reactions_text = ! empty( $this->attributes['text'] ) ? $this->attributes['text'] : $this->customizer->get( |
| 44 |
'betterdocs_post_reactions_text', __( 'What are your Feelings', 'betterdocs' ) |
| 45 |
); |
| 46 |
|
| 47 |
return [ |
| 48 |
'reactions_text' => $reactions_text |
| 49 |
]; |
| 50 |
} |
| 51 |
} |
| 52 |
|