| 1 |
<?php |
| 2 |
/** |
| 3 |
* Render class for Advanced Heading widget. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\General\DropCaps; |
| 9 |
|
| 10 |
use RadiusTheme\SB\Helpers\Fns; |
| 11 |
use RadiusTheme\SB\Elementor\Render\GeneralAddons; |
| 12 |
|
| 13 |
// Do not allow directly accessing this file. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit( 'This script cannot be accessed directly.' ); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Render class. |
| 20 |
* |
| 21 |
* @package RadiusTheme\SB |
| 22 |
*/ |
| 23 |
class Render extends GeneralAddons { |
| 24 |
/** |
| 25 |
* Main render function for displaying content. |
| 26 |
* |
| 27 |
* @param array $data Data to be passed to the template. |
| 28 |
* @param array $settings Widget settings. |
| 29 |
* |
| 30 |
* @return string |
| 31 |
*/ |
| 32 |
public function display_content( $data, $settings ) { |
| 33 |
$this->settings = $settings; |
| 34 |
$data = wp_parse_args( $this->get_template_args(), $data ); |
| 35 |
$data = apply_filters( 'rtsb/general/dropcaps/args/' . $data['unique_name'], $data ); |
| 36 |
$data['content'] = Fns::load_template( $data['template'], $data, true ); |
| 37 |
|
| 38 |
return $this->addon_view( $data, $settings ); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Retrieves template arguments based on widget settings. |
| 43 |
* |
| 44 |
* @return array |
| 45 |
*/ |
| 46 |
private function get_template_args() { |
| 47 |
return [ |
| 48 |
'drop_content' => $this->settings['drop_content'], |
| 49 |
]; |
| 50 |
} |
| 51 |
} |
| 52 |
|