PluginProbe
QuadMenu – Mega Menu / 3.3.8
QuadMenu – Mega Menu v3.3.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / redux / ReduxCore / inc / class.redux_api.php

class.redux_api.php in QuadMenu – Mega Menu 3.3.8, at redux/ReduxCore/inc/class.redux_api.php

663 lines 20.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Redux Framework API Class
5 * Makes instantiating a Redux object an absolute piece of cake.
6 *
7 * @package Redux_Framework
8 * @author Dovy Paukstys
9 * @subpackage Core
10 */
11
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 // Don't duplicate me!
18 if ( ! class_exists( 'ReduxLegacy' ) ) {
19
20 /**
21 * Redux API Class
22 * Simple API for Redux Framework
23 *
24 * @since 1.0.0
25 */
26 class ReduxLegacy {
27
28 public static $fields = array();
29 public static $sections = array();
30 public static $help = array();
31 public static $args = array();
32 public static $priority = array();
33 public static $errors = array();
34 public static $init = array();
35 public static $extensions = array();
36 public static $uses_extensions = array();
37
38 public function __call( $closure, $args ) {
39 return call_user_func_array( $this->{$closure}->bindTo( $this ), $args );
40 }
41
42 public function __toString() {
43 return call_user_func( $this->{'__toString'}->bindTo( $this ) );
44 }
45
46 public static function load() {
47 add_action( 'after_setup_theme', array( 'ReduxLegacy', 'createRedux' ) );
48 add_action( 'init', array( 'ReduxLegacy', 'createRedux' ) );
49 add_action( 'switch_theme', array( 'ReduxLegacy', 'createRedux' ) );
50 }
51
52 public static function init( $opt_name = '' ) {
53 if ( ! empty( $opt_name ) ) {
54 self::loadRedux( $opt_name );
55 remove_action( 'setup_theme', array( 'ReduxLegacy', 'createRedux' ) );
56 }
57 }
58
59 public static function loadExtensions( $ReduxFrameworkLegacy ) {
60 if ( $instanceExtensions = self::getExtensions( $ReduxFrameworkLegacy->args['opt_name'], '' ) ) {
61 foreach ( $instanceExtensions as $name => $extension ) {
62 if ( ! class_exists( $extension['class'] ) ) {
63 // In case you wanted override your override, hah.
64 $extension['path'] = apply_filters( 'redux/extension/' . $ReduxFrameworkLegacy->args['opt_name'] . '/' . $name, $extension['path'] );
65 if ( file_exists( $extension['path'] ) ) {
66 require_once $extension['path'];
67 }
68 }
69 if ( ! isset( $ReduxFrameworkLegacy->extensions[ $name ] ) ) {
70 if ( class_exists( $extension['class'] ) ) {
71 $ReduxFrameworkLegacy->extensions[ $name ] = new $extension['class']( $ReduxFrameworkLegacy );
72 // if (isset($ReduxFrameworkLegacy->extensions[ $name ]->min_redux_version)) {
73 // var_dump($ReduxFrameworkLegacy->extensions[ $name ]->min_redux_version);
74 // }
75
76 } else {
77 echo '<div id="message" class="error"><p>No class named <strong>' . $extension['class'] . '</strong> exists. Please verify your extension path.</p></div>';
78 }
79 }
80 }
81 }
82 }
83
84 public static function extensionPath( $extension, $folder = true ) {
85 if ( ! isset( self::$extensions[ $extension ] ) ) {
86 return;
87 }
88 $path = end( self::$extensions[ $extension ] );
89 if ( ! $folder ) {
90 return $path;
91 }
92
93 return str_replace( 'extension_' . $extension . '.php', '', $path );
94 }
95
96
97 public static function loadRedux( $opt_name = '' ) {
98
99 if ( empty( $opt_name ) ) {
100 return;
101 }
102
103 $check = ReduxFrameworkInstancesLegacy::get_instance( $opt_name );
104
105 if ( isset( $check->apiHasRun ) ) {
106 return;
107 }
108
109 $args = self::constructArgs( $opt_name );
110 $sections = self::constructSections( $opt_name );
111 if ( ! class_exists( 'ReduxFrameworkLegacy' ) ) {
112 echo '<div id="message" class="error"><p>Redux Framework is <strong>not installed</strong>. Please install it.</p></div>';
113
114 return;
115 }
116
117 if ( isset( self::$uses_extensions[ $opt_name ] ) && ! empty( self::$uses_extensions[ $opt_name ] ) ) {
118 add_action( "redux/extensions/{$opt_name}/before", array( 'Redux', 'loadExtensions' ), 0 );
119 }
120
121 $redux = new ReduxFrameworkLegacy( $sections, $args );
122 $redux->apiHasRun = 1;
123 self::$init[ $opt_name ] = 1;
124 if ( isset( $redux->args['opt_name'] ) && $redux->args['opt_name'] != $opt_name ) {
125 self::$init[ $redux->args['opt_name'] ] = 1;
126 }
127 }
128
129 public static function createRedux() {
130 foreach ( self::$sections as $opt_name => $theSections ) {
131 if ( ! self::$init[ $opt_name ] ) {
132 self::loadRedux( $opt_name );
133 }
134 }
135 }
136
137 public static function constructArgs( $opt_name ) {
138 $args = isset( self::$args[ $opt_name ] ) ? self::$args[ $opt_name ] : array();
139
140 $args['opt_name'] = $opt_name;
141 if ( ! isset( $args['menu_title'] ) ) {
142 $args['menu_title'] = ucfirst( $opt_name ) . ' Options';
143 }
144 if ( ! isset( $args['page_title'] ) ) {
145 $args['page_title'] = ucfirst( $opt_name ) . ' Options';
146 }
147 if ( ! isset( $args['page_slug'] ) ) {
148 $args['page_slug'] = $opt_name . '_options';
149 }
150
151 return $args;
152 }
153
154 public static function constructSections( $opt_name ) {
155 $sections = array();
156 if ( ! isset( self::$sections[ $opt_name ] ) ) {
157 return $sections;
158
159 }
160 foreach ( self::$sections[ $opt_name ] as $section_id => $section ) {
161 $section['fields'] = self::constructFields( $opt_name, $section_id );
162 $p = $section['priority'];
163 while ( isset( $sections[ $p ] ) ) {
164 ++$p;
165 }
166 $sections[ $p ] = $section;
167 }
168 ksort( $sections );
169
170 return $sections;
171 }
172
173 public static function constructFields( $opt_name = '', $section_id = '' ) {
174 $fields = array();
175 if ( ! empty( self::$fields[ $opt_name ] ) ) {
176 foreach ( self::$fields[ $opt_name ] as $key => $field ) {
177 if ( $field['section_id'] == $section_id ) {
178 $p = $field['priority'];
179 while ( isset( $fields[ $p ] ) ) {
180 echo $p++;
181 }
182 $fields[ $p ] = $field;
183 }
184 }
185 }
186 ksort( $fields );
187
188 return $fields;
189 }
190
191 public static function getSection( $opt_name = '', $id = '' ) {
192 self::check_opt_name( $opt_name );
193 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
194 if ( ! isset( self::$sections[ $opt_name ][ $id ] ) ) {
195 $id = strtolower( sanitize_html_class( $id ) );
196 }
197
198 return isset( self::$sections[ $opt_name ][ $id ] ) ? self::$sections[ $opt_name ][ $id ] : false;
199 }
200
201 return false;
202 }
203
204 public static function setSections( $opt_name = '', $sections = array() ) {
205 self::check_opt_name( $opt_name );
206 if ( ! empty( $sections ) ) {
207 foreach ( $sections as $section ) {
208 self::setSection( $opt_name, $section );
209 }
210 }
211 }
212
213 public static function getSections( $opt_name = '' ) {
214 self::check_opt_name( $opt_name );
215 if ( ! empty( self::$sections[ $opt_name ] ) ) {
216 return self::$sections[ $opt_name ];
217 }
218
219 return array();
220 }
221
222 public static function removeSection( $opt_name = '', $id = '', $fields = false ) {
223 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
224 if ( isset( self::$sections[ $opt_name ][ $id ] ) ) {
225 $priority = '';
226
227 foreach ( self::$sections[ $opt_name ] as $key => $section ) {
228 if ( $key == $id ) {
229 $priority = $section['priority'];
230 --self::$priority[ $opt_name ]['sections'];
231 unset( self::$sections[ $opt_name ][ $id ] );
232 continue;
233 }
234 if ( $priority != '' ) {
235 $newPriority = $section['priority'];
236 $section['priority'] = $priority;
237 self::$sections[ $opt_name ][ $key ] = $section;
238 $priority = $newPriority;
239 }
240 }
241
242 if ( isset( self::$fields[ $opt_name ] ) && ! empty( self::$fields[ $opt_name ] ) && $fields == true ) {
243 foreach ( self::$fields[ $opt_name ] as $key => $field ) {
244 if ( $field['section_id'] == $id ) {
245 unset( self::$fields[ $opt_name ][ $key ] );
246 }
247 }
248 }
249 }
250 }
251 }
252
253 public static function setSection( $opt_name = '', $section = array() ) {
254
255 self::check_opt_name( $opt_name );
256 if ( empty( $section ) ) {
257 return;
258 }
259 if ( ! isset( $section['id'] ) ) {
260 if ( isset( $section['type'] ) && $section['type'] == 'divide' ) {
261 $section['id'] = time();
262 } elseif ( isset( $section['title'] ) ) {
263 $section['id'] = strtolower( sanitize_title( $section['title'] ) );
264 } else {
265 $section['id'] = time();
266 }
267 if ( ! isset( $section['id'] ) ) {
268 print_r( $section );
269 echo 'DOVY';
270 }
271
272 if ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) {
273 $orig = $section['id'];
274 $i = 0;
275 while ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) {
276 $section['id'] = $orig . '_' . $i;
277
278 ++$i;
279 }
280 }
281 }
282
283 if ( ! empty( $opt_name ) && is_array( $section ) && ! empty( $section ) ) {
284 if ( ! isset( $section['id'] ) && ! isset( $section['title'] ) ) {
285 self::$errors[ $opt_name ]['section']['missing_title'] = 'Unable to create a section due to missing id and title.';
286
287 return;
288 }
289 if ( ! isset( $section['priority'] ) ) {
290 $section['priority'] = self::getPriority( $opt_name, 'sections' );
291 }
292 if ( isset( $section['fields'] ) ) {
293 if ( ! empty( $section['fields'] ) && is_array( $section['fields'] ) ) {
294 self::processFieldsArray( $opt_name, $section['id'], $section['fields'] );
295 }
296 unset( $section['fields'] );
297 }
298 self::$sections[ $opt_name ][ $section['id'] ] = $section;
299 } else {
300 self::$errors[ $opt_name ]['section']['empty'] = 'Unable to create a section due an empty section array or the section variable passed was not an array.';
301
302 return;
303 }
304 }
305
306 public static function hideSection( $opt_name = '', $id = '', $hide = true ) {
307 self::check_opt_name( $opt_name );
308
309 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
310 if ( isset( self::$sections[ $opt_name ][ $id ] ) ) {
311 self::$sections[ $opt_name ][ $id ]['hidden'] = $hide;
312 }
313 }
314 }
315
316 public static function processFieldsArray( $opt_name = '', $section_id = '', $fields = array() ) {
317 if ( ! empty( $opt_name ) && ! empty( $section_id ) && is_array( $fields ) && ! empty( $fields ) ) {
318 foreach ( $fields as $field ) {
319 if ( ! is_array( $field ) ) {
320 continue;
321 }
322 $field['section_id'] = $section_id;
323 self::setField( $opt_name, $field );
324 }
325 }
326 }
327
328 public static function getField( $opt_name = '', $id = '' ) {
329 self::check_opt_name( $opt_name );
330 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
331 return isset( self::$fields[ $opt_name ][ $id ] ) ? self::$fields[ $opt_name ][ $id ] : false;
332 }
333
334 return false;
335 }
336
337 public static function hideField( $opt_name = '', $id = '', $hide = true ) {
338 self::check_opt_name( $opt_name );
339
340 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
341 if ( isset( self::$fields[ $opt_name ][ $id ] ) ) {
342 if ( ! $hide ) {
343 self::$fields[ $opt_name ][ $id ]['class'] = str_replace( 'hidden', '', self::$fields[ $opt_name ][ $id ]['class'] );
344 } else {
345 self::$fields[ $opt_name ][ $id ]['class'] .= 'hidden';
346 }
347 }
348 }
349 }
350
351 public static function setField( $opt_name = '', $field = array() ) {
352 self::check_opt_name( $opt_name );
353
354 if ( ! empty( $opt_name ) && is_array( $field ) && ! empty( $field ) ) {
355
356 if ( ! isset( $field['priority'] ) ) {
357 $field['priority'] = self::getPriority( $opt_name, 'fields' );
358 }
359 if ( isset( $field['id'] ) ) {
360 self::$fields[ $opt_name ][ $field['id'] ] = $field;
361 }
362 }
363 }
364
365 public static function removeField( $opt_name = '', $id = '' ) {
366 self::check_opt_name( $opt_name );
367
368 if ( ! empty( $opt_name ) && ! empty( $id ) ) {
369 if ( isset( self::$fields[ $opt_name ][ $id ] ) ) {
370 foreach ( self::$fields[ $opt_name ] as $key => $field ) {
371 if ( $key == $id ) {
372 $priority = $field['priority'];
373 --self::$priority[ $opt_name ]['fields'];
374 unset( self::$fields[ $opt_name ][ $id ] );
375 continue;
376 }
377 if ( isset( $priority ) && $priority != '' ) {
378 $newPriority = $field['priority'];
379 $field['priority'] = $priority;
380 self::$fields[ $opt_name ][ $key ] = $field;
381 $priority = $newPriority;
382 }
383 }
384 }
385 }
386
387 return false;
388 }
389
390 public static function setHelpTab( $opt_name = '', $tab = array() ) {
391 self::check_opt_name( $opt_name );
392 if ( ! empty( $opt_name ) && ! empty( $tab ) ) {
393 if ( ! isset( self::$args[ $opt_name ]['help_tabs'] ) ) {
394 self::$args[ $opt_name ]['help_tabs'] = array();
395 }
396 if ( isset( $tab['id'] ) ) {
397 self::$args[ $opt_name ]['help_tabs'][] = $tab;
398 } elseif ( is_array( end( $tab ) ) ) {
399 foreach ( $tab as $tab_item ) {
400 self::$args[ $opt_name ]['help_tabs'][] = $tab_item;
401 }
402 }
403 }
404 }
405
406 public static function setHelpSidebar( $opt_name = '', $content = '' ) {
407 self::check_opt_name( $opt_name );
408 if ( ! empty( $opt_name ) && ! empty( $content ) ) {
409 self::$args[ $opt_name ]['help_sidebar'] = $content;
410 }
411 }
412
413 public static function setArgs( $opt_name = '', $args = array() ) {
414 self::check_opt_name( $opt_name );
415 if ( ! empty( $opt_name ) && ! empty( $args ) && is_array( $args ) ) {
416 if ( isset( self::$args[ $opt_name ] ) && isset( self::$args[ $opt_name ]['clearArgs'] ) ) {
417 self::$args[ $opt_name ] = array();
418 }
419 self::$args[ $opt_name ] = wp_parse_args( $args, self::$args[ $opt_name ] );
420 }
421 }
422
423 public static function getArgs( $opt_name = '' ) {
424 self::check_opt_name( $opt_name );
425 if ( ! empty( $opt_name ) && ! empty( self::$args[ $opt_name ] ) ) {
426 return self::$args[ $opt_name ];
427 }
428 }
429
430 public static function getArg( $opt_name = '', $key = '' ) {
431 self::check_opt_name( $opt_name );
432 if ( ! empty( $opt_name ) && ! empty( $key ) && ! empty( self::$args[ $opt_name ] ) ) {
433 return self::$args[ $opt_name ][ $key ];
434 } else {
435 return;
436 }
437 }
438
439 public static function getOption( $opt_name = '', $key = '' ) {
440 self::check_opt_name( $opt_name );
441
442 if ( ! empty( $opt_name ) && ! empty( $key ) ) {
443 $redux = get_option( $opt_name );
444
445 if ( isset( $redux[ $key ] ) ) {
446 return $redux[ $key ];
447 } else {
448 return;
449 }
450 } else {
451 return;
452 }
453 }
454
455 public static function setOption( $opt_name = '', $key = '', $option = '' ) {
456 self::check_opt_name( $opt_name );
457
458 if ( ! empty( $opt_name ) && ! empty( $key ) ) {
459 $redux = get_option( $opt_name );
460 $redux[ $key ] = $option;
461
462 return update_option( $opt_name, $redux );
463 } else {
464 return false;
465 }
466 }
467
468 public static function getPriority( $opt_name, $type ) {
469 $priority = self::$priority[ $opt_name ][ $type ];
470 self::$priority[ $opt_name ][ $type ] += 1;
471
472 return $priority;
473 }
474
475 public static function check_opt_name( $opt_name = '' ) {
476 if ( empty( $opt_name ) || is_array( $opt_name ) ) {
477 return;
478 }
479 if ( ! isset( self::$sections[ $opt_name ] ) ) {
480 self::$sections[ $opt_name ] = array();
481 self::$priority[ $opt_name ]['sections'] = 1;
482 }
483 if ( ! isset( self::$args[ $opt_name ] ) ) {
484 self::$args[ $opt_name ] = array();
485 self::$priority[ $opt_name ]['args'] = 1;
486 }
487 if ( ! isset( self::$fields[ $opt_name ] ) ) {
488 self::$fields[ $opt_name ] = array();
489 self::$priority[ $opt_name ]['fields'] = 1;
490 }
491 if ( ! isset( self::$help[ $opt_name ] ) ) {
492 self::$help[ $opt_name ] = array();
493 self::$priority[ $opt_name ]['help'] = 1;
494 }
495 if ( ! isset( self::$errors[ $opt_name ] ) ) {
496 self::$errors[ $opt_name ] = array();
497 }
498 if ( ! isset( self::$init[ $opt_name ] ) ) {
499 self::$init[ $opt_name ] = false;
500 }
501 }
502
503 /**
504 * Retrieve metadata from a file. Based on WP Core's get_file_data function
505 *
506 * @since 2.1.1
507 *
508 * @param string $file Path to the file
509 *
510 * @return string
511 */
512 public static function getFileVersion( $file ) {
513 $data = get_file_data( $file, array( 'version' ), 'plugin' );
514
515 return $data[0];
516 }
517
518 public static function checkExtensionClassFile( $opt_name, $name = '', $class_file = '', $instance = '' ) {
519 if ( file_exists( $class_file ) ) {
520
521 self::$uses_extensions[ $opt_name ] = isset( self::$uses_extensions[ $opt_name ] ) ? self::$uses_extensions[ $opt_name ] : array();
522 if ( ! in_array( $name, self::$uses_extensions[ $opt_name ] ) ) {
523 self::$uses_extensions[ $opt_name ][] = $name;
524 }
525
526 self::$extensions[ $name ] = isset( self::$extensions[ $name ] ) ? self::$extensions[ $name ] : array();
527 $version = ReduxLegacy_Helpers::get_template_version( $class_file );
528 if ( empty( $version ) && ! empty( $instance ) ) {
529 if ( isset( $instance->version ) ) {
530 $version = $instance->version;
531 }
532 }
533 self::$extensions[ $name ][ $version ] = isset( self::$extensions[ $name ][ $version ] ) ? self::$extensions[ $name ][ $version ] : $class_file;
534
535 $api_check = str_replace( 'extension_' . $name, $name . '_api', $class_file );
536 if ( file_exists( $api_check ) && ! class_exists( 'ReduxLegacy_' . ucfirst( $name ) ) ) {
537 include_once $api_check;
538 }
539 }
540 }
541
542 public static function setExtensions( $opt_name, $path ) {
543 if ( is_dir( $path ) ) {
544 $path = trailingslashit( $path );
545 $folder = str_replace( '.php', '', basename( $path ) );
546 if ( file_exists( $path . 'extension_' . $folder . '.php' ) ) {
547 self::checkExtensionClassFile( $opt_name, $folder, $path . 'extension_' . $folder . '.php' );
548 } else {
549 $folders = scandir( $path, 1 );
550 foreach ( $folders as $folder ) {
551 if ( $folder === '.' or $folder === '..' or $folder[0] == '.' ) {
552 continue;
553 }
554 if ( file_exists( $path . $folder . '/extension_' . $folder . '.php' ) ) {
555 self::checkExtensionClassFile( $opt_name, $folder, $path . $folder . '/extension_' . $folder . '.php' );
556 } elseif ( is_dir( $path . $folder ) ) {
557 self::setExtensions( $opt_name, $path . $folder );
558 continue;
559 }
560 }
561 }
562 } elseif ( file_exists( $path ) ) {
563 $name = explode( 'extension_', basename( $path ) );
564 if ( isset( $name[1] ) && ! empty( $name[1] ) ) {
565 $name = str_replace( '.php', '', $name[1] );
566 self::checkExtensionClassFile( $opt_name, $name, $path );
567 }
568 }
569 }
570
571 /**
572 * Method to disables Redux demo mode popup.
573 */
574 public static function disable_demo() {
575 add_action( 'ReduxFrameworkPlugin_admin_notice', 'ReduxLegacy::remove_demo', 0 );
576 add_action( 'redux_framework_plugin_admin_notice', 'ReduxLegacy::remove_demo', 0 );
577 }
578
579 /**
580 * Callback used by Redux::disable_demo() to remove the demo mode notice from Redux.
581 */
582 function remove_demo() {
583 update_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', '' );
584 }
585
586 public static function getAllExtensions() {
587 $redux = ReduxFrameworkInstancesLegacy::get_all_instances();
588 foreach ( $redux as $instance ) {
589 if ( ! empty( self::$uses_extensions[ $instance['args']['opt_name'] ] ) ) {
590 continue;
591 }
592 if ( ! empty( $instance['extensions'] ) ) {
593
594 self::getInstanceExtensions( $instance['args']['opt_name'], $instance );
595 }
596 }
597 }
598
599 public static function getInstanceExtensions( $opt_name, $instance = array() ) {
600 if ( ! empty( self::$uses_extensions[ $opt_name ] ) ) {
601 return;
602 }
603 if ( empty( $instance ) ) {
604 $instance = ReduxFrameworkInstancesLegacy::get_instance( $opt_name );
605 }
606 if ( empty( $instance ) || empty( $instance->extensions ) ) {
607 return;
608 }
609 foreach ( $instance->extensions as $name => $extension ) {
610 if ( $name == 'widget_areas' ) {
611 $new = new ReduxLegacy_Widget_Areas( $instance );
612 }
613 if ( isset( self::$uses_extensions[ $opt_name ][ $name ] ) ) {
614 continue;
615 }
616 if ( isset( $extension->extension_dir ) ) {
617 self::setExtensions( $opt_name, str_replace( $name, '', $extension->extension_dir ) );
618
619 } elseif ( isset( $extension->_extension_dir ) ) {
620 self::setExtensions( $opt_name, str_replace( $name, '', $extension->_extension_dir ) );
621 }
622 }
623 }
624
625 public static function getExtensions( $opt_name = '', $key = '' ) {
626
627 if ( empty( $opt_name ) ) {
628 self::getAllExtensions();
629 if ( empty( $key ) ) {
630 return self::$extension_paths;
631 } elseif ( isset( self::$extension_paths[ $key ] ) ) {
632 return self::$extension_paths[ $key ];
633 }
634 } else {
635 if ( empty( self::$uses_extensions[ $opt_name ] ) ) {
636 self::getInstanceExtensions( $opt_name );
637 }
638
639 if ( empty( self::$uses_extensions[ $opt_name ] ) ) {
640 return false;
641 }
642 $instanceExtensions = array();
643 foreach ( self::$uses_extensions[ $opt_name ] as $extension ) {
644 $class_file = end( self::$extensions[ $extension ] );
645 $name = str_replace( '.php', '', basename( $extension ) );
646 $extension_class = 'ReduxFrameworkLegacy_Extension_' . $name;
647 $instanceExtensions[ $extension ] = array(
648 'path' => $class_file,
649 'class' => $extension_class,
650 'version' => ReduxLegacy_Helpers::get_template_version( $class_file ),
651 );
652 }
653
654 return $instanceExtensions;
655 }
656
657 return false;
658 }
659 }
660
661 ReduxLegacy::load();
662 }
663