store( $redux_framework ); } else { add_action( 'redux/construct', array( $this, 'store' ), 5, 1 ); } } /** * Action hook callback. * * @param object $redux_framework Pointer. */ public function store( $redux_framework ) { if ( $redux_framework instanceof ReduxFramework ) { $key = $redux_framework->args['opt_name']; self::$instances[ $key ] = $redux_framework; } } } } if ( ! class_exists( 'ReduxFrameworkInstances' ) ) { class_alias( 'Redux_Instances', 'ReduxFrameworkInstances' ); } if ( ! function_exists( 'get_redux_instance' ) ) { /** * Shim function that some theme oddly used. * * @param string|false $opt_name the defined opt_name. * * @return ReduxFramework class instance */ function get_redux_instance( $opt_name ) { return Redux_Instances::get_instance( $opt_name ); } } if ( ! function_exists( 'get_all_redux_instances' ) ) { /** * Fetch all instances of ReduxFramework * as an associative array. * * @return array format ['opt_name' => $ReduxFramework] */ function get_all_redux_instances(): ?array { return Redux_Instances::get_all_instances(); } }