| 1 |
<?php |
| 2 |
|
| 3 |
class LSD_Element_Embed extends LSD_Element |
| 4 |
{ |
| 5 |
public $key = 'embed'; |
| 6 |
public $label; |
| 7 |
|
| 8 |
public function __construct() |
| 9 |
{ |
| 10 |
parent::__construct(); |
| 11 |
|
| 12 |
$this->label = esc_html__('Embed', 'listdom'); |
| 13 |
$this->has_title_settings = false; |
| 14 |
$this->pro_needed = true; |
| 15 |
} |
| 16 |
|
| 17 |
public function get($post_id = null) |
| 18 |
{ |
| 19 |
// Disabled in Lite |
| 20 |
if ($this->isLite()) return false; |
| 21 |
|
| 22 |
if (is_null($post_id)) |
| 23 |
{ |
| 24 |
global $post; |
| 25 |
$post_id = $post->ID; |
| 26 |
} |
| 27 |
|
| 28 |
// Generate output |
| 29 |
ob_start(); |
| 30 |
include lsd_template('elements/embeds.php'); |
| 31 |
|
| 32 |
return $this->content( |
| 33 |
ob_get_clean(), |
| 34 |
$this, |
| 35 |
[ |
| 36 |
'post_id' => $post_id, |
| 37 |
] |
| 38 |
); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
|