Skip to content

Commit 9cd4026

Browse files
committed
Restore old method of retrieving filesystem for old extensions, and slapped a deprecation notice on it.
1 parent 9babba3 commit 9cd4026

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

redux-core/framework.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,15 @@ public static function init() {
359359
*/
360360
public bool $never_save_to_db;
361361

362+
/**
363+
* File system object used for I/O file operations. Done the WordPress way.
364+
*
365+
* @var null|object
366+
*
367+
* @deprecated 4.5.1
368+
*/
369+
public ?object $filesystem;
370+
362371
/**
363372
* Deprecated shim for v3 templates.
364373
*
@@ -404,6 +413,19 @@ public function __wakeup() {
404413
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ eh?', 'redux-framework' ), '4.0' );
405414
}
406415

416+
/**
417+
* Add a deprecating notice for all the old themes that still use this method..
418+
*
419+
* @param object $filesystem Filesystem object.
420+
*
421+
* @since 4.0.0
422+
*/
423+
private function deprecated_filesystem( $filesystem ) {
424+
_deprecated_function( esc_html__( 'The global variable "$filesystem" of the ReduxFramework object', 'redux-framework' ), '4.5.1', 'Redux_Core::$filesystem' );
425+
426+
return $filesystem;
427+
}
428+
407429
/**
408430
* Class Constructor. Defines the args for the theme options class
409431
*
@@ -456,6 +478,8 @@ public function __construct( array $sections = array(), array $args = array() )
456478

457479
Redux_Core::$filesystem = Redux_Filesystem::get_instance( $this );
458480

481+
$this->filesystem = $this->deprecated_filesystem( Redux_Core::$filesystem );
482+
459483
/**
460484
* Filter 'redux/options/{opt_name}/sections'
461485
*

0 commit comments

Comments
 (0)