@@ -328,6 +328,8 @@ private function init() {
328
328
329
329
// phpcs:ignore WordPress.NamingConventions.ValidHookName
330
330
self ::$ upload_url = apply_filters ( 'redux/upload_url ' , self ::$ upload_url );
331
+
332
+ self ::load_template_libraries ();
331
333
}
332
334
333
335
/**
@@ -343,6 +345,28 @@ public static function core_construct( $parent, array $args ) {
343
345
344
346
}
345
347
348
+ /**
349
+ * Load Redux and Extendify template libraries.
350
+ *
351
+ * @return void
352
+ */
353
+ private static function load_template_libraries (){
354
+ self ::$ redux_templates_enabled = (bool ) get_option ( 'use_redux_templates ' );
355
+ self ::$ extendify_templates_enabled = (bool ) get_option ( 'use_extendify_templates ' , true );
356
+
357
+ // Including extendify sdk.
358
+ if ( true === (bool ) get_option ( 'use_extendify_templates ' , true ) ) {
359
+ if ( file_exists ( dirname ( __FILE__ ) . '/extendify-sdk/loader.php ' ) ) {
360
+ $ GLOBALS ['extendifySdkSourcePlugin ' ] = 'Redux ' ;
361
+ require_once dirname ( __FILE__ ) . '/extendify-sdk/loader.php ' ;
362
+ }
363
+ }
364
+
365
+ if ( file_exists ( dirname ( __FILE__ ) . '/redux-templates/redux-templates.php ' ) ) {
366
+ require_once dirname ( __FILE__ ) . '/redux-templates/redux-templates.php ' ;
367
+ }
368
+ }
369
+
346
370
/**
347
371
* Autoregister run.
348
372
*
@@ -353,9 +377,6 @@ private function includes() {
353
377
self ::$ pro_loaded = true ;
354
378
}
355
379
356
- self ::$ redux_templates_enabled = (bool ) get_option ( 'use_redux_templates ' );
357
- self ::$ extendify_templates_enabled = (bool ) get_option ( 'use_extendify_templates ' , true );
358
-
359
380
require_once dirname ( __FILE__ ) . '/inc/classes/class-redux-path.php ' ;
360
381
require_once dirname ( __FILE__ ) . '/inc/classes/class-redux-functions-ex.php ' ;
361
382
require_once dirname ( __FILE__ ) . '/inc/classes/class-redux-helpers.php ' ;
@@ -368,18 +389,6 @@ private function includes() {
368
389
self ::$ welcome = new Redux_Welcome ();
369
390
new Redux_Rest_Api_Builder ( $ this );
370
391
371
- // Including extendify sdk.
372
- if ( true === (bool ) get_option ( 'use_extendify_templates ' , true ) ) {
373
- if ( file_exists ( dirname ( __FILE__ ) . '/extendify-sdk/loader.php ' ) ) {
374
- $ GLOBALS ['extendifySdkSourcePlugin ' ] = 'Redux ' ;
375
- require_once dirname ( __FILE__ ) . '/extendify-sdk/loader.php ' ;
376
- }
377
- }
378
-
379
- if ( file_exists ( dirname ( __FILE__ ) . '/redux-templates/redux-templates.php ' ) ) {
380
- require_once dirname ( __FILE__ ) . '/redux-templates/redux-templates.php ' ;
381
- }
382
-
383
392
add_action ( 'admin_init ' , array ( $ this , 'admin_init ' ) );
384
393
385
394
add_filter ( 'debug_information ' , array ( $ this , 'add_debug_info ' ) );
0 commit comments