| 1 | <?php |
||
| 9 | abstract class Wordlift_Shortcode { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * The shortcode, set by extending classes. |
||
| 13 | */ |
||
| 14 | const SHORTCODE = NULL; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Create a shortcode instance by registering the shortcode with the render |
||
| 18 | * function. |
||
| 19 | * |
||
| 20 | * @since 3.5.4 |
||
| 21 | */ |
||
| 22 | public function __construct() { |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Render the shortcode. |
||
| 30 | * |
||
| 31 | * @since 3.5.4 |
||
| 32 | * |
||
| 33 | * @param array $atts An array of shortcode attributes as set by the editor. |
||
| 34 | * |
||
| 35 | * @return string The output html code. |
||
| 36 | */ |
||
| 37 | public abstract function render( $atts ); |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Enqueue scripts. Called by the shortcode implementations in their render |
||
| 41 | * method. |
||
| 42 | * |
||
| 43 | * @since 3.5.4 |
||
| 44 | */ |
||
| 45 | protected function enqueue_scripts() { |
||
| 56 | |||
| 57 | } |
||
| 58 |