. * * @package ReduxFramework * @author Kevin Provance (kprovance) * @version 3.5.4 */ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } // Don't duplicate me! if ( ! class_exists( 'ReduxFramework_options_object' ) ) { /** * Main ReduxFramework_options_object class * * @since 1.0.0 */ class ReduxFramework_options_object { /** * Field Constructor. * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function * * @since 1.0.0 * @access public * @return void */ function __construct( $field = array(), $value = '', $parent ) { $this->parent = $parent; $this->field = $field; $this->value = $value; $this->is_field = $this->parent->extensions['options_object']->is_field; $this->extension_dir = ReduxFramework::$_dir . 'inc/extensions/options_object/'; $this->extension_url = ReduxFramework::$_url . 'inc/extensions/options_object/'; // Set default args for this field to avoid bad indexes. Change this to anything you use. $defaults = array( 'options' => array(), 'stylesheet' => '', 'output' => true, 'enqueue' => true, 'enqueue_frontend' => true ); $this->field = wp_parse_args( $this->field, $defaults ); } /** * Field Render Function. * Takes the vars and outputs the HTML for the field in the settings * * @since 1.0.0 * @access public * @return void */ public function render() { if ( version_compare( phpversion(), "5.3.0", ">=" ) ) { $json = json_encode( $this->parent->options ); } else { $json = json_encode( $this->parent->options ); } $defaults = array( 'full_width' => true, 'overflow' => 'inherit', ); $this->field = wp_parse_args( $this->field, $defaults ); if ( $this->is_field ) { $fullWidth = $this->field['full_width']; } $bDoClose = false; $id = $this->parent->args['opt_name'] . '-' . $this->field['id']; if ( ! $this->is_field || ( $this->is_field && false == $fullWidth ) ) { ?>

extension_url . 'options_object/field_options_object' . Redux_Functions::isMin() . '.js', array( 'jquery' ), ReduxFramework_extension_options_object::$version, true ); wp_enqueue_style( 'redux-options-object', $this->extension_url . 'options_object/field_options_object.css', array(), time(), 'all' ); } /** * Output Function. * Used to enqueue to the front-end * * @since 1.0.0 * @access public * @return void */ public function output() { if ( $this->field['enqueue_frontend'] ) { } } } }