PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.2
Elementor Website Builder – more than just a page builder v3.32.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/api.php +21 -1 3.32.13.32.2 View file →
@@ -17,8 +17,13 @@
17 17 */
18 18 class Api {
19 19
20 20 /**
21 + * Elementor library option key.
22 + */
23 + const LIBRARY_OPTION_KEY = 'elementor_remote_info_library';
24 +
25 + /**
21 26 * Elementor feed option key.
22 27 */
23 28 const FEED_OPTION_KEY = 'elementor_remote_info_feed_data';
24 29
@@ -218,9 +223,24 @@
218 223 }
219 224
220 225 $library_data = json_decode( wp_remote_retrieve_body( $response ), true );
221 226
222 - return empty( $library_data ) ? [] : $library_data;
227 + /**
228 + * Filters the library data to allow 3rd party extending the response data.
229 + *
230 + * @since 3.32.2
231 + * @param-out array $library_data an array of templates data.
232 + */
233 + $library_data = apply_filters( 'elementor/remote/library/data', $library_data );
234 +
235 + if ( empty( $library_data ) || ! is_array( $library_data ) ) {
236 + return [];
237 + }
238 +
239 + // the following update & get are a temporary measure, to allow 3rd party plugins inject more templates:
240 + update_option( self::LIBRARY_OPTION_KEY, $library_data, 'no' );
241 +
242 + return get_option( self::LIBRARY_OPTION_KEY, $library_data );
223 243 }
224 244
225 245 /**
226 246 * Get feed data.