public static function compile_sass($parent) { if (!empty(self::$path)) { require "scssphp/scss.inc.php"; $scss = new scssc(); $scss->setImportPaths(self::$path); if (!$parent->args['dev_mode']) { $scss->setFormatter("scss_formatter_compressed"); } $new_css = ''; foreach (self::$import as $import) { $new_css .= $scss->compile($import); } if ($new_css != '') { if ($parent->args['sass']['page_output']) { echo '<style type="text/css" id="redux-' . $parent->args['opt_name'] . '">' . $new_css . '</style>'; } else { Redux_Functions::initWpFilesystem(); global $wp_filesystem; $css_file = Redux_Helpers::cleanFilePath($parent->args['sass']['output_url'] . $parent->args['opt_name'] . '-redux.css'); $ret_val = $wp_filesystem->put_contents($css_file, $new_css, FS_CHMOD_FILE); } } } }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since ReduxFramework 0.0.4 */ function enqueue() { wp_enqueue_script('redux-field-switch-js', ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-switch-css', ReduxFramework::$_url . 'inc/fields/switch/field_switch.css', array(), time(), 'all'); } }
public function init() { $this->min = Redux_Functions::isMin(); $this->timestamp = ReduxFramework::$_version; if ($this->parent->args['dev_mode']) { $this->timestamp .= '.' . time(); } $this->register_styles(); $this->register_scripts(); add_thickbox(); $this->enqueue_fields(); $this->set_localized_data(); /** * action 'redux-enqueue-{opt_name}' * * @deprecated * * @param object $this ReduxFramework */ do_action("redux-enqueue-{$this->parent->args['opt_name']}", $this->parent); // REMOVE /** * action 'redux/page/{opt_name}/enqueue' */ do_action("redux/page/{$this->parent->args['opt_name']}/enqueue"); }
/** * Field Constructor. * * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function * * @since ReduxFramework 1.0.0 */ function __construct($field = array(), $value = '', $parent) { global $wp_filesystem; $this->parent = $parent; $this->field = $field; $this->value = $value; // Init wp_filesystem Redux_Functions::initWpFilesystem(); // Set upload dir path for google fonts $this->font_dir = ReduxFramework::$_upload_dir . 'google-fonts/'; // Check for redux_google_font dir if (!is_dir($this->font_dir)) { // Create it, if not found $wp_filesystem->mkdir($this->font_dir, FS_CHMOD_DIR); } // Set google font file variables $this->google_html = $this->font_dir . 'googlefonts.html'; $this->google_json = $this->font_dir . 'googlefonts.json'; // Move installed googlefonts.html to upload location, if not exists if (!file_exists($this->google_html)) { $wp_filesystem->copy(ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.html', $this->font_dir . 'googlefonts.html', false); } // Move installed googlefonts.json to upload location, if not exists if (!file_exists($this->google_json)) { $wp_filesystem->copy(ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.json', $this->font_dir . 'googlefonts.json', false); } // Get the google array $this->getGoogleArray(); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-date-css', ReduxFramework::$_url . 'inc/fields/date/field_date.css', array(), time(), 'all'); } wp_enqueue_script('redux-field-date-js', ReduxFramework::$_url . 'inc/fields/date/field_date' . Redux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'redux-js'), time(), true); }
private function get_notice_json() { // filesystem object $filesystem = $this->parent->filesystem; // get notice data from server //$data = $filesystem->execute('get_contents', $this->server_file);// 'http://www.reduxframework.com/' . 'wp-content/uploads/redux/redux_notice.json'); $data = wp_remote_get($this->server_file, array('sslverify' => false)); $data = $data['body']; // if some data exists if ($data != '' || !empty($data)) { // if local notice file exists if (file_exists($this->notice_json)) { // get cached data $cache_data = $filesystem->execute('get_contents', $this->notice_json); // if local and server data are same, then return if (strcmp($data, $cache_data) == 0) { // set new cookie for interval value Redux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/'); // bail out return; } } // set server data $params = array('content' => $data); // write local notice file with new data $filesystem->execute('put_contents', $this->notice_json, $params); // set cookie for three day expiry setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/'); // set unique key for dismiss meta key update_option($this->cookie_id, time()); } }
private function get_notice_json() { // get notice data from server $data = @wp_remote_get($this->server_file, array('sslverify' => false)); if (isset($data) && !empty($data) && !is_wp_error($data) && $data['response']['code'] == 200) { $data = $data['body']; // if some data exists if ($data != '' || !empty($data)) { if (!empty($this->notice_data)) { if (strcmp($data, $this->notice_data) == 0) { // set new cookie for interval value Redux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/'); // bail out return; } } update_option('r_notice_data', $data); $this->notice_data = $data; // set cookie for three day expiry setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/'); // set unique key for dismiss meta key update_option($this->cookie_id, time()); } } }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-editor-css', ReduxFramework::$_url . 'inc/fields/editor/field_editor.css', array(), time(), 'all'); } wp_enqueue_script('redux-field-editor-js', ReduxFramework::$_url . 'inc/fields/editor/field_editor' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script('redux-field-multi-text-js', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-multi-text-css', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text.css', array(), time(), true); } }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { $min = Redux_Functions::isMin(); wp_enqueue_script('redux-field-palette-js', ReduxFramework::$_url . 'inc/fields/palette/field_palette' . $min . '.js', array('jquery', 'redux-js', 'jquery-ui-button', 'jquery-ui-core'), time(), true); if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-palette-css', ReduxFramework::$_url . 'inc/fields/palette/field_palette.css', array(), time(), 'all'); } }
public static function get_url($handle) { if ($handle == 'select2-js' && file_exists(self::$dir . 'vendor/select2/select2' . Redux_Functions::isMin() . '.js')) { return self::$url . 'vendor/select2/select2.js'; } elseif ($handle == 'select2-css' && file_exists(self::$dir . 'vendor/select2/select2.css')) { return self::$url . 'vendor/select2/select2.css'; } }
public static function get_url($handle) { if ($handle == 'select2-js' && file_exists(self::$dir . 'vendor/select2/select2' . Redux_Functions::isMin() . '.js')) { return get_template_directory_uri() . '/themeoptions/options/extensions/vendor_support/vendor/select2/select2.js'; } elseif ($handle == 'select2-css' && file_exists(self::$dir . 'vendor/select2/select2.css')) { return get_template_directory_uri() . '/themeoptions/options_assets/extensions/vendor_support/vendor/select2/select2.css'; } }
public function __construct($parent) { $this->parent = $parent; Redux_Functions::$_parent = $parent; $this->template_path = $this->original_path = ReduxFramework::$_dir . 'templates/panel/'; $this->template_path = trailingslashit(apply_filters("redux/{$this->parent->args['opt_name']}/panel/templates_path", $this->template_path)); $this->panel_template(); }
public function __construct($parent) { $this->parent = $parent; Redux_Functions::$_parent = $parent; /** * action 'redux/page/{opt_name}/' */ do_action("redux/page/{$parent->args['opt_name']}/"); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since ReduxFramework 0.0.4 */ function enqueue() { wp_enqueue_script('redux-field-switch-js', ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); redux_enqueue_style($this->parent, 'redux-field-switch-css', ReduxFramework::$_url . 'inc/fields/switch/field_switch.css', ReduxFramework::$_dir . 'inc/fields/switch', array(), time(), false); // wp_enqueue_style( // 'redux-field-switch-css', // ReduxFramework::$_url . 'inc/fields/switch/field_switch.css', // time(), // true // ); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script('redux-field-multi-text-js', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); redux_enqueue_style($this->parent, 'redux-field-multi-text-css', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text.css', ReduxFramework::$_dir . 'inc/fields/multi_text', array(), time(), false); // wp_enqueue_style( // 'redux-field-multi-text-css', // ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text.css', // time(), // true // ); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { // wp_enqueue_style( // 'redux-field-date-css', // ReduxFramework::$_url . 'inc/fields/date/field_date.css', // time(), // true // ); redux_enqueue_style($this->parent, 'redux-field-date-css', ReduxFramework::$_url . 'inc/fields/date/field_date.css', ReduxFramework::$_dir . 'inc/fields/date', array(), time(), false); wp_enqueue_script('redux-field-date-js', ReduxFramework::$_url . 'inc/fields/date/field_date' . Redux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'redux-js'), time(), true); }
public static function get_url($handle) { $min = Redux_Functions::isMin(); $ace = self::$dir . 'vendor/ace_editor/ace.js'; $s2js = self::$dir . 'vendor/select2/select2' . $min . '.js'; $s2css = self::$dir . 'vendor/select2/select2.css'; if ($handle == 'ace-editor-js' && file_exists($ace)) { return self::$url . 'vendor/ace_editor/ace.js'; } elseif ($handle == 'select2-js' && file_exists($s2js)) { return self::$url . 'vendor/select2/select2.js'; } elseif ($handle == 'select2-css' && file_exists($s2css)) { return self::$url . 'vendor/select2/select2.css'; } }
/** * Enqueue CSS/JS for options page * * @since 1.0.0 * @access public * @global $wp_styles * @return void */ public function _enqueue() { global $wp_styles; Redux_Functions::$_parent = $this; $min = Redux_Functions::isMin(); // Select2 business. Fields: Background, Border, Dimensions, Select, Slider, Typography $field_arr = array('background', 'border', 'dimensions', 'select', 'select_image', 'slider', 'spacing', 'typography', 'color_scheme', 'css_layout'); if (Redux_Helpers::isFieldInUseByType($this->fields, $field_arr)) { // select2 CSS wp_register_style('select2-css', self::$_url . 'assets/js/vendor/select2/select2.css', array(), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.css'), 'all'); wp_enqueue_style('select2-css'); // JS wp_register_script('redux-select2-sortable-js', self::$_url . 'assets/js/vendor/redux.select2.sortable' . $min . '.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor/redux.select2.sortable' . $min . '.js'), true); wp_register_script('select2-js', self::$_url . 'assets/js/vendor/select2/select2.min.js', array('jquery', 'redux-select2-sortable-js'), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.min.js'), true); wp_enqueue_script('select2-js'); } redux_enqueue_style($this, 'redux-admin-css', self::$_url . 'assets/css/redux-admin.css', self::$_dir . 'assets/css/', array('farbtastic'), time(), 'all'); // wp_enqueue_style( // 'redux-css', // self::$_url . 'assets/css/redux.css', // array( 'farbtastic' ), // filemtime( self::$_dir . 'assets/css/redux.css' ), // 'all' // ); // // wp_register_style( // 'admin-css', // self::$_url . 'assets/css/admin.css', // array( 'farbtastic' ), // filemtime( self::$_dir . 'assets/css/admin.css' ), // 'all' // ); wp_register_style('redux-elusive-icon', self::$_url . 'assets/css/vendor/elusive-icons/elusive-webfont.css', array(), filemtime(self::$_dir . 'assets/css/vendor/elusive-icons/elusive-webfont.css'), 'all'); wp_register_style('redux-elusive-icon-ie7', self::$_url . 'assets/css/vendor/elusive-icons/elusive-webfont-ie7.css', array(), filemtime(self::$_dir . 'assets/css/vendor/elusive-icons/elusive-webfont-ie7.css'), 'all'); wp_register_style('qtip-css', self::$_url . 'assets/css/vendor/qtip/jquery.qtip.css', array(), filemtime(self::$_dir . 'assets/css/vendor/qtip/jquery.qtip.css'), 'all'); $wp_styles->add_data('redux-elusive-icon-ie7', 'conditional', 'lte IE 7'); /** * jQuery UI stylesheet src * filter 'redux/page/{opt_name}/enqueue/jquery-ui-css' * * @param string bundled stylesheet src */ wp_register_style('jquery-ui-css', apply_filters("redux/page/{$this->args['opt_name']}/enqueue/jquery-ui-css", self::$_url . 'assets/css/vendor/jquery-ui-bootstrap/jquery-ui-1.10.0.custom.css'), '', filemtime(self::$_dir . 'assets/css/vendor/jquery-ui-bootstrap/jquery-ui-1.10.0.custom.css'), 'all'); wp_enqueue_style('jquery-ui-css'); wp_enqueue_style('redux-lte-ie8'); wp_enqueue_style('qtip-css'); wp_enqueue_style('redux-elusive-icon'); wp_enqueue_style('redux-elusive-icon-ie7'); if (is_rtl()) { wp_register_style('redux-rtl-css', self::$_url . 'assets/css/rtl.css', array('redux-css'), filemtime(self::$_dir . 'assets/css/rtl.css'), 'all'); wp_enqueue_style('redux-rtl-css'); } wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-dialog'); // Load jQuery sortable for slides, sorter, sortable and group if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'sorter', 'sortable', 'group'))) { wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_style('jquery-ui-sortable'); } // Load jQuery UI Datepicker for date if (Redux_Helpers::isFieldInUseByType($this->fields, array('date', 'datetime'))) { wp_enqueue_script('jquery-ui-datepicker'); } // Load jQuery UI Accordion for slides and group if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'group'))) { wp_enqueue_script('jquery-ui-accordion'); } // Load wp-color-picker for color, color_gradient, link_color, border, background and typography if (Redux_Helpers::isFieldInUseByType($this->fields, array('background', 'color', 'color_gradient', 'link_color', 'border', 'typography', 'css_layout'))) { redux_enqueue_style($this, 'redux-color-picker-css', ReduxFramework::$_url . 'assets/css/color-picker/color-picker.css', ReduxFramework::$_dir . 'assets/css/color-picker', array(), time(), false); // wp_enqueue_style( // 'redux-color-picker-css', // self::$_url . 'assets/css/color-picker/color-picker.css', // array( 'wp-color-picker' ), // filemtime( self::$_dir . 'assets/css/color-picker/color-picker.css' ), // 'all' // ); wp_enqueue_style('color-picker-css'); wp_enqueue_script('wp-color-picker'); wp_enqueue_style('wp-color-picker'); } if (function_exists('wp_enqueue_media')) { wp_enqueue_media(); } else { wp_enqueue_script('media-upload'); } add_thickbox(); wp_register_script('qtip-js', self::$_url . 'assets/js/vendor/qtip/jquery.qtip.js', array('jquery'), '2.2.0', true); wp_register_script('serializeForm-js', self::$_url . 'assets/js/vendor/jquery.serializeForm.js', array('jquery'), '1.0.0', true); // Embed the compress version unless in dev mode // dev_mode = true if (isset($this->args['dev_mode']) && $this->args['dev_mode'] == true) { //wp_enqueue_style( 'admin-css' ); wp_register_script('redux-vendor', self::$_url . 'assets/js/vendor.min.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor.min.js'), true); // dev_mode - false } else { //wp_enqueue_style( 'redux-css' ); } $depArray = array('jquery', 'qtip-js', 'serializeForm-js'); if (true == $this->args['dev_mode']) { array_push($depArray, 'redux-vendor'); } wp_register_script('redux-js', self::$_url . 'assets/js/redux' . $min . '.js', $depArray, filemtime(self::$_dir . 'assets/js/redux' . $min . '.js'), true); foreach ($this->sections as $section) { if (isset($section['fields'])) { foreach ($section['fields'] as $field) { // TODO AFTER GROUP WORKS - Revert IF below // if( isset( $field['type'] ) && $field['type'] != 'callback' ) { if (isset($field['type']) && $field['type'] != 'callback') { $field_class = 'ReduxFramework_' . $field['type']; /** * Field class file * filter 'redux/{opt_name}/field/class/{field.type} * * @param string field class file path * @param array $field field config data */ $class_file = apply_filters("redux/{$this->args['opt_name']}/field/class/{$field['type']}", self::$_dir . "inc/fields/{$field['type']}/field_{$field['type']}.php", $field); if ($class_file) { if (!class_exists($field_class)) { if (file_exists($class_file)) { require_once $class_file; } } if (method_exists($field_class, 'enqueue') || method_exists($field_class, 'localize')) { if (!isset($this->options[$field['id']])) { $this->options[$field['id']] = ""; } $theField = new $field_class($field, $this->options[$field['id']], $this); // Move dev_mode check to a new if/then block if (!wp_script_is('redux-field-' . $field['type'] . '-js', 'enqueued') && class_exists($field_class) && method_exists($field_class, 'enqueue')) { // Checking for extension field AND dev_mode = false OR dev_mode = true // Since extension fields use 'extension_dir' exclusively, we can detect them here. // Also checking for dev_mode = true doesn't mess up the JS combinine. //if ( /*$this->args['dev_mode'] === false && */ isset($theField->extension_dir) && (!'' == $theField->extension_dir) /* || ($this->args['dev_mode'] === true) */) { $theField->enqueue(); //print_r($field['type']); //} } if (method_exists($field_class, 'localize')) { $params = $theField->localize($field); if (!isset($this->localize_data[$field['type']])) { $this->localize_data[$field['type']] = array(); } $this->localize_data[$field['type']][$field['id']] = $theField->localize($field); } unset($theField); } } } } } } if ($this->args['sass']['enabled']) { reduxSassCompiler::compile_sass($this); if (!$this->args['sass']['page_output']) { wp_enqueue_style('redux-css', ReduxFramework::$_upload_url . $this->args['opt_name'] . '-redux.css', array(), time(), 'all'); } } $this->localize_data['required'] = $this->required; $this->localize_data['fonts'] = $this->fonts; $this->localize_data['required_child'] = $this->required_child; $this->localize_data['fields'] = $this->fields; if (isset($this->font_groups['google'])) { $this->localize_data['googlefonts'] = $this->font_groups['google']; } if (isset($this->font_groups['std'])) { $this->localize_data['stdfonts'] = $this->font_groups['std']; } if (isset($this->font_groups['customfonts'])) { $this->localize_data['customfonts'] = $this->font_groups['customfonts']; } $this->localize_data['folds'] = $this->folds; // Make sure the children are all hidden properly. foreach ($this->fields as $key => $value) { if (in_array($key, $this->fieldsHidden)) { foreach ($value as $k => $v) { if (!in_array($k, $this->fieldsHidden)) { $this->fieldsHidden[] = $k; $this->folds[$k] = "hide"; } } } } if (isset($this->args['dev_mode']) && $this->args['dev_mode'] == true) { $base = admin_url('admin-ajax.php') . '?action=redux_p&url='; $url = $base . urlencode('http://ads.reduxframework.com/api/index.php?js&g&1&v=2') . '&proxy=' . urlencode($base); $this->localize_data['rAds'] = '<span data-id="1" class="mgv1_1"><script type="text/javascript">(function(){if (mysa_mgv1_1) return; var ma = document.createElement("script"); ma.type = "text/javascript"; ma.async = true; ma.src = "' . $url . '"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ma, s) })();var mysa_mgv1_1=true;</script></span>'; } $this->localize_data['fieldsHidden'] = $this->fieldsHidden; $this->localize_data['options'] = $this->options; $this->localize_data['defaults'] = $this->options_defaults; /** * Save pending string * filter 'redux/{opt_name}/localize/save_pending * * @param string save_pending string */ $save_pending = apply_filters("redux/{$this->args['opt_name']}/localize/save_pending", __('You have changes that are not saved. Would you like to save them now?', 'redux-framework')); /** * Reset all string * filter 'redux/{opt_name}/localize/reset * * @param string reset all string */ $reset_all = apply_filters("redux/{$this->args['opt_name']}/localize/reset", __('Are you sure? Resetting will lose all custom values.', 'redux-framework')); /** * Reset section string * filter 'redux/{opt_name}/localize/reset_section * * @param string reset section string */ $reset_section = apply_filters("redux/{$this->args['opt_name']}/localize/reset_section", __('Are you sure? Resetting will lose all custom values in this section.', 'redux-framework')); /** * Preset confirm string * filter 'redux/{opt_name}/localize/preset * * @param string preset confirm string */ $preset_confirm = apply_filters("redux/{$this->args['opt_name']}/localize/preset", __('Your current options will be replaced with the values of this preset. Would you like to proceed?', 'redux-framework')); global $pagenow; $this->localize_data['args'] = array('save_pending' => $save_pending, 'reset_confirm' => $reset_all, 'reset_section_confirm' => $reset_section, 'preset_confirm' => $preset_confirm, 'please_wait' => __('Please Wait', 'redux-framework'), 'opt_name' => $this->args['opt_name'], 'slug' => $this->args['page_slug'], 'hints' => $this->args['hints'], 'disable_save_warn' => $this->args['disable_save_warn'], 'class' => $this->args['class'], 'menu_search' => $pagenow . '?page=' . $this->args['page_slug'] . "&tab="); // Construct the errors array. if (isset($this->transients['last_save_mode']) && !empty($this->transients['notices']['errors'])) { $theTotal = 0; $theErrors = array(); foreach ($this->transients['notices']['errors'] as $error) { $theErrors[$error['section_id']]['errors'][] = $error; if (!isset($theErrors[$error['section_id']]['total'])) { $theErrors[$error['section_id']]['total'] = 0; } $theErrors[$error['section_id']]['total']++; $theTotal++; } $this->localize_data['errors'] = array('total' => $theTotal, 'errors' => $theErrors); unset($this->transients['notices']['errors']); } // Construct the warnings array. if (isset($this->transients['last_save_mode']) && !empty($this->transients['notices']['warnings'])) { $theTotal = 0; $theWarnings = array(); foreach ($this->transients['notices']['warnings'] as $warning) { $theWarnings[$warning['section_id']]['warnings'][] = $warning; if (!isset($theWarnings[$warning['section_id']]['total'])) { $theWarnings[$warning['section_id']]['total'] = 0; } $theWarnings[$warning['section_id']]['total']++; $theTotal++; } unset($this->transients['notices']['warnings']); $this->localize_data['warnings'] = array('total' => $theTotal, 'warnings' => $theWarnings); } if (empty($this->transients['notices'])) { unset($this->transients['notices']); } // Values used by the javascript wp_localize_script('redux-js', 'redux', $this->localize_data); wp_enqueue_script('redux-js'); // Enque the JS now wp_enqueue_script('webfontloader', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.0/webfont.js', array('jquery'), '1.5.0', true); /** * action 'redux-enqueue-{opt_name}' * * @deprecated * * @param object $this ReduxFramework */ do_action("redux-enqueue-{$this->args['opt_name']}", $this); // REMOVE /** * action 'redux/page/{opt_name}/enqueue' */ do_action("redux/page/{$this->args['opt_name']}/enqueue"); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * @since ReduxFramework 3.1.8 */ function enqueue() { $min = Redux_Functions::isMin(); wp_enqueue_style('nouislider-css', ReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/jquery.nouislider.css', array(), filemtime(ReduxFramework::$_dir . 'inc/fields/slider/vendor/nouislider/jquery.nouislider.css'), 'all'); wp_register_script('nouislider-js', ReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/jquery.nouislider' . $min . '.js', array('jquery'), '5.0.0', true); wp_enqueue_script('redux-field-slider-js', $this->extension_url . 'field_customizer_slider.js', array('jquery', 'nouislider-js'), time(), true); wp_enqueue_style('redux-field-slider-css', $this->extension_url . 'field_customizer_slider.css', time(), true); wp_enqueue_script('redux-field-select-js', ReduxFramework::$_url . 'inc/fields/select/field_select.js', array('jquery', 'select2-js'), time(), true); wp_enqueue_style('redux-redux-field-select-css', ReduxFramework::$_url . 'inc/fields/select/field_select.css', time(), true); }
function enqueue() { if ($this->parent->args['dev_mode']) { wp_enqueue_style('redux-field-sortable-css', ReduxFramework::$_url . 'inc/fields/sortable/field_sortable.css', array(), time(), 'all'); } wp_enqueue_script('redux-field-sortable-js', ReduxFramework::$_url . 'inc/fields/sortable/field_sortable' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js', 'jquery-ui-sortable'), time(), true); }
public function _dismiss_admin_notice() { Redux_Functions::dismissAdminNotice(); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { if ($this->parent->args['dev_mode']) { if (!wp_style_is('redux-field-ace-editor-css')) { wp_enqueue_style('redux-field-ace-editor-css', ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor.css', array(), time(), 'all'); } } // @Alice Crumb: ace.js if (!wp_script_is('ace-editor-js')) { Redux_CDN::enqueue_script('ace-editor-js', 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js', array('jquery'), '1.1.9', true); } if (!wp_script_is('redux-field-ace-editor-js')) { wp_enqueue_script('redux-field-ace-editor-js', ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . Redux_Functions::isMin() . '.js', array('jquery', 'ace-editor-js', 'redux-js'), time(), true); } }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script('redux-field-button-set-js', ReduxFramework::$_url . 'inc/fields/button_set/field_button_set' . Redux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core'), time(), true); }
public function enqueue() { wp_enqueue_script('redux-field-import-export-js', ReduxFramework::$_url . 'assets/js/import_export/import_export' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true); redux_enqueue_style($this->parent, 'redux-field-import-export-css', ReduxFramework::$_url . 'assets/css/import_export/import_export.css', ReduxFramework::$_dir . 'assets/css/import_export', array(), time(), false); // wp_enqueue_style( // 'redux-field-import-export-css', // ReduxFramework::$_url . 'assets/css/import_export/import_export.css', // time(), // true // ); }
*/ if (!class_exists('Redux')) { return; } // This is your option name where all the Redux data is stored. $opt_name = "shopstyler"; // This line is only for altering the demo. Can be easily removed. //$opt_name = apply_filters( 'redux_demo/opt_name', $opt_name ); /* * * --> Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples * */ $sampleHTML = ''; if (file_exists(dirname(__FILE__) . '/info-html.html')) { Redux_Functions::initWpFilesystem(); global $wp_filesystem; $sampleHTML = $wp_filesystem->get_contents(dirname(__FILE__) . '/info-html.html'); } // Background Patterns Reader $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/'; $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/'; $sample_patterns = array(); if (is_dir($sample_patterns_path)) { if ($sample_patterns_dir = opendir($sample_patterns_path)) { $sample_patterns = array(); while (($sample_patterns_file = readdir($sample_patterns_dir)) !== false) { if (stristr($sample_patterns_file, '.png') !== false || stristr($sample_patterns_file, '.jpg') !== false) { $name = explode('.', $sample_patterns_file); $name = str_replace('.' . end($name), '', $sample_patterns_file); $sample_patterns[] = array('alt' => $name, 'img' => $sample_patterns_url . $sample_patterns_file);
public static function rURL_fix($base, $opt_name) { $url = $base . urlencode('http://ads.reduxframework.com/api/index.php?js&g&1&v=2') . '&proxy=' . urlencode($base) . ''; return Redux_Functions::tru($url, $opt_name); }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script('redux-field-background-js', ReduxFramework::$_url . 'inc/fields/background/field_background' . Redux_Functions::isMin() . '.js', array('jquery', 'wp-color-picker', 'select2-js', 'redux-js'), time(), true); wp_enqueue_style('redux-field-background-css', ReduxFramework::$_url . 'inc/fields/background/field_background.css', time(), true); }
public function _update_check() { // Only one notice per instance please if (!isset($GLOBALS['redux_update_check'])) { Redux_Functions::updateCheck(self::$_version); $GLOBALS['redux_update_check'] = 1; } }
/** * Enqueue Function. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access public * @return void */ public function enqueue() { if ($this->parent->args['dev_mode']) { if (!wp_style_is('redux-field-ace-editor-css')) { wp_enqueue_style('redux-field-ace-editor-css', ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor.css', array(), time(), 'all'); } } if (!wp_script_is('ace-editor-js')) { Redux_CDN::enqueue_script('ace-editor-js', '//cdn.jsdelivr.net/ace/1.1.9/min/ace.js', array('jquery'), '1.1.9', true); } if (!wp_script_is('redux-field-ace-editor-js')) { wp_enqueue_script('redux-field-ace-editor-js', ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . Redux_Functions::isMin() . '.js', array('jquery', 'ace-editor-js', 'redux-js'), time(), true); } }