1 | <?php |
||
15 | abstract class IframeEmbedButton { |
||
16 | |||
17 | |||
18 | /** |
||
19 | * @var string $iframe_name |
||
20 | */ |
||
21 | private $iframe_name; |
||
22 | |||
23 | /** |
||
24 | * @var string $route_name |
||
25 | */ |
||
26 | private $route_name; |
||
27 | |||
28 | /** |
||
29 | * @var string $title |
||
30 | */ |
||
31 | private $title; |
||
32 | |||
33 | /** |
||
34 | * @var string $slug |
||
35 | */ |
||
36 | private $slug; |
||
37 | |||
38 | /** |
||
39 | * @var boolean $append_filterable_content |
||
40 | */ |
||
41 | private $append_filterable_content; |
||
42 | |||
43 | |||
44 | |||
45 | /** |
||
46 | * IframeEmbedButton constructor. |
||
47 | * |
||
48 | * @param string $iframe_name |
||
49 | * @param string $route_name |
||
50 | * @param string $title |
||
51 | * @param string $slug |
||
52 | */ |
||
53 | public function __construct($iframe_name, $route_name, $title, $slug) { |
||
59 | |||
60 | |||
61 | |||
62 | /** |
||
63 | * Adds an iframe embed code button to the Event editor. |
||
64 | */ |
||
65 | public function addEventEditorIframeEmbedButtonFilter() |
||
80 | |||
81 | |||
82 | |||
83 | /** |
||
84 | * @param $permalink_string |
||
85 | * @param $id |
||
86 | * @return string |
||
87 | */ |
||
88 | public function appendIframeEmbedButtonToSamplePermalinkHtml( $permalink_string, $id ) { |
||
94 | |||
95 | |||
96 | |||
97 | /** |
||
98 | * iframe embed code button to the Event editor. |
||
99 | * |
||
100 | * @param string $permalink_string |
||
101 | * @param int $id |
||
102 | * @return string |
||
103 | */ |
||
104 | public function eventEditorIframeEmbedButton( |
||
122 | |||
123 | |||
124 | /** |
||
125 | * Adds an iframe embed code button via a WP do_action() as determined by the first parameter |
||
126 | * |
||
127 | * @param string $action name of the WP do_action() to hook into |
||
128 | */ |
||
129 | public function addActionIframeEmbedButton($action) { |
||
137 | |||
138 | |||
139 | |||
140 | /** |
||
141 | * @return void |
||
142 | */ |
||
143 | public function addActionIframeEmbedButtonCallback() |
||
147 | |||
148 | |||
149 | |||
150 | /** |
||
151 | * Adds an iframe embed code button via a WP apply_filters() as determined by the first parameter |
||
152 | * |
||
153 | * @param string $filter name of the WP apply_filters() to hook into |
||
154 | * @param bool $append if true, will add iframe embed button to end of content, |
||
155 | * else if false, will add to the beginning of the content |
||
156 | */ |
||
157 | public function addFilterIframeEmbedButton($filter, $append = true) { |
||
166 | |||
167 | |||
168 | |||
169 | /** |
||
170 | * @param array|string $filterable_content |
||
171 | * @return array|string |
||
172 | */ |
||
173 | public function addFilterIframeEmbedButtonCallback($filterable_content) |
||
187 | |||
188 | /** |
||
189 | * iframe_embed_html |
||
190 | * |
||
191 | * @param array $query_args |
||
192 | * @param string $button_class |
||
193 | * @return string |
||
194 | */ |
||
195 | public function embedButtonHtml($query_args = array(), $button_class = '' ) { |
||
234 | |||
235 | |||
236 | |||
237 | /** |
||
238 | * enqueue iframe button js |
||
239 | */ |
||
240 | public function embedButtonAssets() { |
||
258 | |||
259 | |||
260 | |||
261 | /** |
||
262 | * generates embed button sections for admin pages |
||
263 | * |
||
264 | * @param array $embed_buttons |
||
265 | * @return string |
||
266 | */ |
||
267 | public function addIframeEmbedButtonsSection(array $embed_buttons) |
||
286 | |||
287 | |||
288 | } |
||
289 | // End of file IframeEmbedButton.php |
||
290 | // Location: EventEspresso\core\libraries\iframe_display/IframeEmbedButton.php |