ActionsGenerator.php
9 months ago
AddRatingGenerator.php
1 year ago
CourseMetaGenerator.php
9 months ago
ElementGenerator.php
1 year ago
MaterialGenerator.php
1 year ago
Preview.php
1 year ago
PriceGenerator.php
9 months ago
SocialLinkGenerator.php
1 year ago
ThumbnailGenerator.php
1 year ago
ElementGenerator.php
42 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Preview script for html markup generator |
| 4 | * |
| 5 | * @package tutor-droip-elements |
| 6 | */ |
| 7 | |
| 8 | namespace TutorLMSDroip\ElementGenerator; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; // Exit if accessed directly. |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Class ElementGenerator |
| 16 | * |
| 17 | * This class is used to define all helper functions. |
| 18 | */ |
| 19 | class ElementGenerator { |
| 20 | |
| 21 | /** |
| 22 | * ElementGenerator constructor. |
| 23 | */ |
| 24 | public function __construct() { |
| 25 | add_filter( 'droip_element_generator_' . TDE_APP_PREFIX, array( $this, 'droip_element_generator' ), 10, 2 ); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Droip element generator |
| 30 | * This function is used to generate the droip elements |
| 31 | * |
| 32 | * @param string $string string. |
| 33 | * @param array $props array. //this props contains all the attributes of the droip element. |
| 34 | * |
| 35 | * @return string html. |
| 36 | */ |
| 37 | public function droip_element_generator( $string, $props ) { |
| 38 | $preview = new Preview( $props ); |
| 39 | return $preview->generate_elements(); |
| 40 | } |
| 41 | } |
| 42 |