balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

class-redux-class.php (1166B)


      1 <?php
      2 /**
      3  * Redux Class
      4  *
      5  * @class Redux_Class
      6  * @version 4.0.0
      7  * @package Redux Framework/Classes
      8  */
      9 
     10 defined( 'ABSPATH' ) || exit;
     11 
     12 if ( ! class_exists( 'Redux_Class', false ) ) {
     13 
     14 	/**
     15 	 * Class Redux_Class
     16 	 */
     17 	class Redux_Class {
     18 
     19 		/**
     20 		 * Poiner to ReduxFramework object.
     21 		 *
     22 		 * @var null|ReduxFramework
     23 		 */
     24 		public $parent = null;
     25 
     26 		/**
     27 		 * Global arguments array.
     28 		 *
     29 		 * @var array|mixed|void
     30 		 */
     31 		public $args = array();
     32 
     33 		/**
     34 		 * Project opt_name
     35 		 *
     36 		 * @var mixed|string
     37 		 */
     38 		public $opt_name = '';
     39 
     40 		/**
     41 		 * Redux_Class constructor.
     42 		 *
     43 		 * @param null|object $parent Pointer to ReduxFramework object.
     44 		 */
     45 		public function __construct( $parent = null ) {
     46 			if ( null !== $parent && is_object( $parent ) ) {
     47 				$this->parent   = $parent;
     48 				$this->args     = $parent->args;
     49 				$this->opt_name = $this->args['opt_name'];
     50 			}
     51 		}
     52 
     53 		/**
     54 		 * Pointer to project specific ReduxFramework object.
     55 		 *
     56 		 * @return null|object|ReduxFramework
     57 		 */
     58 		public function core() {
     59 			if ( isset( $this->opt_name ) && '' !== $this->opt_name ) {
     60 				return Redux::instance( $this->opt_name );
     61 			}
     62 
     63 			return null;
     64 		}
     65 
     66 	}
     67 
     68 }