Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/accelera.../includes/options/redux-co...
File: framework.php
<?php
[0] Fix | Delete
namespace ReduxCore\ReduxFramework;
[1] Fix | Delete
/**
[2] Fix | Delete
* Redux Framework is free software: you can redistribute it and/or modify
[3] Fix | Delete
* it under the terms of the GNU General Public License as published by
[4] Fix | Delete
* the Free Software Foundation, either version 3 of the License, or
[5] Fix | Delete
* any later version.
[6] Fix | Delete
* Redux Framework is distributed in the hope that it will be useful,
[7] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[8] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[9] Fix | Delete
* GNU General Public License for more details.
[10] Fix | Delete
* You should have received a copy of the GNU General Public License
[11] Fix | Delete
* along with Redux Framework. If not, see <http://www.gnu.org/licenses/>.
[12] Fix | Delete
*
[13] Fix | Delete
* @package Redux_Framework
[14] Fix | Delete
* @subpackage Core
[15] Fix | Delete
* @author Redux Framework Team
[16] Fix | Delete
*/
[17] Fix | Delete
// Exit if accessed directly
[18] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[19] Fix | Delete
exit;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if ( ! class_exists( 'ReduxCore\\ReduxFramework\\ReduxFrameworkInstances' ) ) {
[23] Fix | Delete
// Instance Container
[24] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_instances.php';
[25] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/lib.redux_instances.php';
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
if ( class_exists( 'ReduxCore\\ReduxFramework\\ReduxFrameworkInstances' ) ) {
[29] Fix | Delete
add_action( 'redux/init', 'ReduxCore\\ReduxFramework\\ReduxFrameworkInstances::get_instance' );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
// Don't duplicate me!
[33] Fix | Delete
if ( ! class_exists( 'ReduxCore\\ReduxFramework\\ReduxFramework' ) ) {
[34] Fix | Delete
[35] Fix | Delete
// Redux CDN class
[36] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_cdn.php';
[37] Fix | Delete
[38] Fix | Delete
// Redux API class :)
[39] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_api.php';
[40] Fix | Delete
[41] Fix | Delete
// General helper functions
[42] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_helpers.php';
[43] Fix | Delete
[44] Fix | Delete
// General functions
[45] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_functions.php';
[46] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.p.php';
[47] Fix | Delete
[48] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.thirdparty.fixes.php';
[49] Fix | Delete
[50] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_filesystem.php';
[51] Fix | Delete
[52] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/class.redux_admin_notices.php';
[53] Fix | Delete
[54] Fix | Delete
// ThemeCheck checks
[55] Fix | Delete
require_once dirname( __FILE__ ) . '/inc/themecheck/class.redux_themecheck.php';
[56] Fix | Delete
[57] Fix | Delete
// Welcome page removed #1526
[58] Fix | Delete
// require_once dirname( __FILE__ ) . '/inc/welcome/welcome.php';
[59] Fix | Delete
[60] Fix | Delete
/**
[61] Fix | Delete
* Main ReduxFramework class
[62] Fix | Delete
*
[63] Fix | Delete
* @since 1.0.0
[64] Fix | Delete
*/
[65] Fix | Delete
class ReduxFramework {
[66] Fix | Delete
[67] Fix | Delete
// ATTENTION DEVS
[68] Fix | Delete
// Please update the build number with each push, no matter how small.
[69] Fix | Delete
// This will make for easier support when we ask users what version they are using.
[70] Fix | Delete
[71] Fix | Delete
public static $_version = '3.6.2';
[72] Fix | Delete
public static $_dir;
[73] Fix | Delete
public static $_url;
[74] Fix | Delete
public static $_upload_dir;
[75] Fix | Delete
public static $_upload_url;
[76] Fix | Delete
public static $wp_content_url;
[77] Fix | Delete
public static $base_wp_content_url;
[78] Fix | Delete
public static $_is_plugin = true;
[79] Fix | Delete
public static $_as_plugin = false;
[80] Fix | Delete
public $old_opt_name;
[81] Fix | Delete
public $transients = array();
[82] Fix | Delete
public $wp_data = array();
[83] Fix | Delete
public $field_types = array();
[84] Fix | Delete
public $field_head = array();
[85] Fix | Delete
public $apiHasRun;
[86] Fix | Delete
public $transients_check;
[87] Fix | Delete
public $validation_ran;
[88] Fix | Delete
[89] Fix | Delete
public static function init() {
[90] Fix | Delete
$dir = Redux_Helpers::cleanFilePath( dirname( __FILE__ ) );
[91] Fix | Delete
[92] Fix | Delete
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
[93] Fix | Delete
self::$_dir = trailingslashit( $dir );
[94] Fix | Delete
self::$wp_content_url = trailingslashit( Redux_Helpers::cleanFilePath( ( is_ssl() ? str_replace( 'http://', 'https://', WP_CONTENT_URL ) : WP_CONTENT_URL ) ) );
[95] Fix | Delete
[96] Fix | Delete
// See if Redux is a plugin or not
[97] Fix | Delete
if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory_uri() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/themes/' ) ) !== false ) {
[98] Fix | Delete
self::$_is_plugin = false;
[99] Fix | Delete
} /*else {
[100] Fix | Delete
// Check if plugin is a symbolic link, see if it's a plugin. If embedded, we can't do a thing.
[101] Fix | Delete
if ( strpos( self::$_dir, ABSPATH ) === false ) {
[102] Fix | Delete
if ( ! function_exists( 'get_plugins' ) ) {
[103] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
$is_plugin = false;
[107] Fix | Delete
foreach ( get_plugins() as $key => $value ) {
[108] Fix | Delete
if ( is_plugin_active( $key ) && strpos( $key, 'redux-framework.php' ) !== false ) {
[109] Fix | Delete
self::$_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/plugins/' . plugin_dir_path( $key ) . 'ReduxCore/' ) );
[110] Fix | Delete
$is_plugin = true;
[111] Fix | Delete
}
[112] Fix | Delete
}
[113] Fix | Delete
if ( ! $is_plugin ) {
[114] Fix | Delete
self::$_is_plugin = false;
[115] Fix | Delete
}
[116] Fix | Delete
}
[117] Fix | Delete
}*/
[118] Fix | Delete
[119] Fix | Delete
if ( self::$_is_plugin == true || self::$_as_plugin == true ) {
[120] Fix | Delete
self::$_url = plugin_dir_url( __FILE__ );
[121] Fix | Delete
} else {
[122] Fix | Delete
if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory() ) ) !== false ) {
[123] Fix | Delete
$relative_url = str_replace( Redux_Helpers::cleanFilePath( get_template_directory() ), '', self::$_dir );
[124] Fix | Delete
self::$_url = trailingslashit( get_template_directory_uri() . $relative_url );
[125] Fix | Delete
} else if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false ) {
[126] Fix | Delete
$relative_url = str_replace( Redux_Helpers::cleanFilePath( get_stylesheet_directory() ), '', self::$_dir );
[127] Fix | Delete
self::$_url = trailingslashit( get_stylesheet_directory_uri() . $relative_url );
[128] Fix | Delete
} else {
[129] Fix | Delete
$wp_content_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR ) );
[130] Fix | Delete
$wp_content_dir = trailingslashit( str_replace( '//', '/', $wp_content_dir ) );
[131] Fix | Delete
$relative_url = str_replace( $wp_content_dir, '', self::$_dir );
[132] Fix | Delete
self::$_url = trailingslashit( self::$wp_content_url . $relative_url );
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
self::$_url = apply_filters( "redux/_url", self::$_url );
[137] Fix | Delete
self::$_dir = apply_filters( "redux/_dir", self::$_dir );
[138] Fix | Delete
self::$_is_plugin = apply_filters( "redux/_is_plugin", self::$_is_plugin );
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
// ::init()
[142] Fix | Delete
[143] Fix | Delete
public $framework_url = 'http://www.reduxframework.com/';
[144] Fix | Delete
public static $instance = null;
[145] Fix | Delete
public $admin_notices = array();
[146] Fix | Delete
public $page = '';
[147] Fix | Delete
public $saved = false;
[148] Fix | Delete
public $fields = array(); // Fields by type used in the panel
[149] Fix | Delete
public $field_sections = array(); // Section id's by field type, then field ID
[150] Fix | Delete
public $current_tab = ''; // Current section to display, cookies
[151] Fix | Delete
public $extensions = array(); // Extensions by type used in the panel
[152] Fix | Delete
public $sections = array(); // Sections and fields
[153] Fix | Delete
public $errors = array(); // Errors
[154] Fix | Delete
public $warnings = array(); // Warnings
[155] Fix | Delete
public $options = array(); // Option values
[156] Fix | Delete
public $options_defaults = null; // Option defaults
[157] Fix | Delete
public $notices = array(); // Option defaults
[158] Fix | Delete
public $compiler_fields = array(); // Fields that trigger the compiler hook
[159] Fix | Delete
public $required = array(); // Information that needs to be localized
[160] Fix | Delete
public $required_child = array(); // Information that needs to be localized
[161] Fix | Delete
public $localize_data = array(); // Information that needs to be localized
[162] Fix | Delete
public $fonts = array(); // Information that needs to be localized
[163] Fix | Delete
public $folds = array(); // The itms that need to fold.
[164] Fix | Delete
public $path = '';
[165] Fix | Delete
public $changed_values = array(); // Values that have been changed on save. Orig values.
[166] Fix | Delete
public $output = array(); // Fields with CSS output selectors
[167] Fix | Delete
public $outputCSS = null; // CSS that get auto-appended to the header
[168] Fix | Delete
public $compilerCSS = null; // CSS that get sent to the compiler hook
[169] Fix | Delete
public $customizerCSS = null; // CSS that goes to the customizer
[170] Fix | Delete
public $fieldsValues = array(); //all fields values in an id=>value array so we can check dependencies
[171] Fix | Delete
public $fieldsHidden = array(); //all fields that didn't pass the dependency test and are hidden
[172] Fix | Delete
public $toHide = array(); // Values to hide on page load
[173] Fix | Delete
public $typography = null; //values to generate google font CSS
[174] Fix | Delete
public $import_export = null;
[175] Fix | Delete
public $no_panel = array(); // Fields that are not visible in the panel
[176] Fix | Delete
private $show_hints = false;
[177] Fix | Delete
public $hidden_perm_fields = array(); // Hidden fields specified by 'permissions' arg.
[178] Fix | Delete
public $hidden_perm_sections = array(); // Hidden sections specified by 'permissions' arg.
[179] Fix | Delete
public $typography_preview = array();
[180] Fix | Delete
public $args = array();
[181] Fix | Delete
public $filesystem = null;
[182] Fix | Delete
public $font_groups = array();
[183] Fix | Delete
public $lang = "";
[184] Fix | Delete
public $dev_mode_forced = false;
[185] Fix | Delete
public $reload_fields = array();
[186] Fix | Delete
public $omit_share_icons = false;
[187] Fix | Delete
public $omit_admin_items = false;
[188] Fix | Delete
[189] Fix | Delete
/**
[190] Fix | Delete
* Class Constructor. Defines the args for the theme options class
[191] Fix | Delete
*
[192] Fix | Delete
* @since 1.0.0
[193] Fix | Delete
*
[194] Fix | Delete
* @param array $sections Panel sections.
[195] Fix | Delete
* @param array $args Class constructor arguments.
[196] Fix | Delete
* @param array $extra_tabs Extra panel tabs. // REMOVE
[197] Fix | Delete
*
[198] Fix | Delete
* @return \ReduxFramework
[199] Fix | Delete
*/
[200] Fix | Delete
public function __construct( $sections = array(), $args = array(), $extra_tabs = array() ) {
[201] Fix | Delete
// Disregard WP AJAX 'heartbeat'call. Why waste resources?
[202] Fix | Delete
if ( isset ( $_POST ) && isset ( $_POST['action'] ) && $_POST['action'] == 'heartbeat' ) {
[203] Fix | Delete
[204] Fix | Delete
// Hook, for purists.
[205] Fix | Delete
if ( ! has_action( 'redux/ajax/heartbeat' ) ) {
[206] Fix | Delete
do_action( 'redux/ajax/heartbeat', $this );
[207] Fix | Delete
}
[208] Fix | Delete
[209] Fix | Delete
// Buh bye!
[210] Fix | Delete
return;
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
// Pass parent pointer to function helper.
[214] Fix | Delete
Redux_Functions::$_parent = $this;
[215] Fix | Delete
Redux_CDN::$_parent = $this;
[216] Fix | Delete
Redux_Admin_Notices::$_parent = $this;
[217] Fix | Delete
[218] Fix | Delete
// Set values
[219] Fix | Delete
$this->set_default_args();
[220] Fix | Delete
$this->args = wp_parse_args( $args, $this->args );
[221] Fix | Delete
[222] Fix | Delete
if ( empty ( $this->args['transient_time'] ) ) {
[223] Fix | Delete
$this->args['transient_time'] = 60 * MINUTE_IN_SECONDS;
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
if ( empty ( $this->args['footer_credit'] ) ) {
[227] Fix | Delete
$this->args['footer_credit'] = '<span id="footer-thankyou">' . sprintf( __( 'Options panel created using %1$s', 'accelerated-mobile-pages' ), '<a href="' . esc_url( $this->framework_url ) . '" target="_blank">' . __( 'Redux Framework', 'accelerated-mobile-pages' ) . '</a> v' . self::$_version ) . '</span>';
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
if ( empty ( $this->args['menu_title'] ) ) {
[231] Fix | Delete
$this->args['menu_title'] = __( 'Options', 'accelerated-mobile-pages' );
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
if ( empty ( $this->args['page_title'] ) ) {
[235] Fix | Delete
$this->args['page_title'] = __( 'Options', 'accelerated-mobile-pages' );
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
$this->old_opt_name = $this->args['opt_name'];
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* filter 'redux/args/{opt_name}'
[242] Fix | Delete
*
[243] Fix | Delete
* @param array $args ReduxFramework configuration
[244] Fix | Delete
*/
[245] Fix | Delete
$this->args = apply_filters( "redux/args/{$this->args['opt_name']}", $this->args );
[246] Fix | Delete
[247] Fix | Delete
/**
[248] Fix | Delete
* filter 'redux/options/{opt_name}/args'
[249] Fix | Delete
*
[250] Fix | Delete
* @param array $args ReduxFramework configuration
[251] Fix | Delete
*/
[252] Fix | Delete
$this->args = apply_filters( "redux/options/{$this->args['opt_name']}/args", $this->args );
[253] Fix | Delete
[254] Fix | Delete
if ( $this->args['opt_name'] == $this->old_opt_name ) {
[255] Fix | Delete
unset( $this->old_opt_name );
[256] Fix | Delete
}
[257] Fix | Delete
[258] Fix | Delete
// Do not save the defaults if we're on a live preview!
[259] Fix | Delete
if ( $GLOBALS['pagenow'] == "customize" && isset( $_GET['theme'] ) && ! empty( $_GET['theme'] ) ) {
[260] Fix | Delete
$this->args['save_defaults'] = false;
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
$this->change_demo_defaults();
[264] Fix | Delete
[265] Fix | Delete
if ( ! empty ( $this->args['opt_name'] ) ) {
[266] Fix | Delete
/**
[267] Fix | Delete
* SHIM SECTION
[268] Fix | Delete
* Old variables and ways of doing things that need correcting. ;)
[269] Fix | Delete
* */
[270] Fix | Delete
// Variable name change
[271] Fix | Delete
if ( ! empty ( $this->args['page_cap'] ) ) {
[272] Fix | Delete
$this->args['page_permissions'] = $this->args['page_cap'];
[273] Fix | Delete
unset ( $this->args['page_cap'] );
[274] Fix | Delete
}
[275] Fix | Delete
[276] Fix | Delete
if ( ! empty ( $this->args['page_position'] ) ) {
[277] Fix | Delete
$this->args['page_priority'] = $this->args['page_position'];
[278] Fix | Delete
unset ( $this->args['page_position'] );
[279] Fix | Delete
}
[280] Fix | Delete
[281] Fix | Delete
if ( ! empty ( $this->args['page_type'] ) ) {
[282] Fix | Delete
$this->args['menu_type'] = $this->args['page_type'];
[283] Fix | Delete
unset ( $this->args['page_type'] );
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
// Get rid of extra_tabs! Not needed.
[287] Fix | Delete
if ( is_array( $extra_tabs ) && ! empty ( $extra_tabs ) ) {
[288] Fix | Delete
foreach ( $extra_tabs as $tab ) {
[289] Fix | Delete
array_push( $this->sections, $tab );
[290] Fix | Delete
}
[291] Fix | Delete
}
[292] Fix | Delete
[293] Fix | Delete
// Move to the first loop area!
[294] Fix | Delete
/**
[295] Fix | Delete
* filter 'redux-sections'
[296] Fix | Delete
*
[297] Fix | Delete
* @deprecated
[298] Fix | Delete
*
[299] Fix | Delete
* @param array $sections field option sections
[300] Fix | Delete
*/
[301] Fix | Delete
$this->sections = apply_filters( 'redux-sections', $sections ); // REMOVE LATER
[302] Fix | Delete
/**
[303] Fix | Delete
* filter 'redux-sections-{opt_name}'
[304] Fix | Delete
*
[305] Fix | Delete
* @deprecated
[306] Fix | Delete
*
[307] Fix | Delete
* @param array $sections field option sections
[308] Fix | Delete
*/
[309] Fix | Delete
$this->sections = apply_filters( "redux-sections-{$this->args['opt_name']}", $this->sections ); // REMOVE LATER
[310] Fix | Delete
/**
[311] Fix | Delete
* filter 'redux/options/{opt_name}/sections'
[312] Fix | Delete
*
[313] Fix | Delete
* @param array $sections field option sections
[314] Fix | Delete
*/
[315] Fix | Delete
$this->sections = apply_filters( "redux/options/{$this->args['opt_name']}/sections", $this->sections );
[316] Fix | Delete
[317] Fix | Delete
/**
[318] Fix | Delete
* Construct hook
[319] Fix | Delete
* action 'redux/construct'
[320] Fix | Delete
*
[321] Fix | Delete
* @param object $this ReduxFramework
[322] Fix | Delete
*/
[323] Fix | Delete
do_action( 'redux/construct', $this );
[324] Fix | Delete
[325] Fix | Delete
// Set the default values
[326] Fix | Delete
$this->_default_cleanup();
[327] Fix | Delete
[328] Fix | Delete
// Internataionalization
[329] Fix | Delete
$this->_internationalization();
[330] Fix | Delete
[331] Fix | Delete
$this->filesystem = Redux_Filesystem::get_instance( $this );
[332] Fix | Delete
[333] Fix | Delete
//set redux upload folder
[334] Fix | Delete
$this->set_redux_content();
[335] Fix | Delete
[336] Fix | Delete
// Register extra extensions
[337] Fix | Delete
$this->_register_extensions();
[338] Fix | Delete
[339] Fix | Delete
// Grab database values
[340] Fix | Delete
$this->get_options();
[341] Fix | Delete
[342] Fix | Delete
// Options page
[343] Fix | Delete
add_action( 'admin_menu', array( $this, '_options_page' ) );
[344] Fix | Delete
[345] Fix | Delete
// Add a network menu
[346] Fix | Delete
if ( $this->args['database'] == "network" && $this->args['network_admin'] ) {
[347] Fix | Delete
add_action( 'network_admin_menu', array( $this, '_options_page' ) );
[348] Fix | Delete
}
[349] Fix | Delete
[350] Fix | Delete
// Admin Bar menu
[351] Fix | Delete
add_action( 'admin_bar_menu', array(
[352] Fix | Delete
$this,
[353] Fix | Delete
'_admin_bar_menu'
[354] Fix | Delete
), $this->args['admin_bar_priority'] );
[355] Fix | Delete
[356] Fix | Delete
// Register setting
[357] Fix | Delete
add_action( 'admin_init', array( $this, '_register_settings' ) );
[358] Fix | Delete
[359] Fix | Delete
// Display admin notices in dev_mode
[360] Fix | Delete
if ( true == $this->args['dev_mode'] ) {
[361] Fix | Delete
if ( true == $this->args['update_notice'] ) {
[362] Fix | Delete
add_action( 'admin_init', array( $this, '_update_check' ) );
[363] Fix | Delete
}
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
// Display admin notices
[367] Fix | Delete
add_action( 'admin_notices', array( $this, '_admin_notices' ), 99 );
[368] Fix | Delete
[369] Fix | Delete
// Check for dismissed admin notices.
[370] Fix | Delete
add_action( 'admin_init', array( $this, '_dismiss_admin_notice' ), 9 );
[371] Fix | Delete
[372] Fix | Delete
// Enqueue the admin page CSS and JS
[373] Fix | Delete
if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) {
[374] Fix | Delete
add_action( 'admin_enqueue_scripts', array( $this, '_enqueue' ), 1 );
[375] Fix | Delete
}
[376] Fix | Delete
[377] Fix | Delete
// Output dynamic CSS
[378] Fix | Delete
// Frontend: Maybe enqueue dynamic CSS and Google fonts
[379] Fix | Delete
if ( empty ( $this->args['output_location'] ) || in_array( 'frontend', $this->args['output_location'] ) ) {
[380] Fix | Delete
add_action( 'wp_head', array( $this, '_output_css'), 150 );
[381] Fix | Delete
add_action( 'wp_enqueue_scripts', array($this, '_enqueue_output'), 150 );
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
// Login page: Maybe enqueue dynamic CSS and Google fonts
[385] Fix | Delete
if ( in_array( 'login', $this->args['output_location'] ) ) {
[386] Fix | Delete
add_action( 'login_head', array( $this, '_output_css'), 150 );
[387] Fix | Delete
add_action( 'login_enqueue_scripts',array( $this, '_enqueue_output'), 150 );
[388] Fix | Delete
}
[389] Fix | Delete
[390] Fix | Delete
// Admin area: Maybe enqueue dynamic CSS and Google fonts
[391] Fix | Delete
if ( in_array( 'admin', $this->args['output_location'] ) ) {
[392] Fix | Delete
add_action( 'admin_head', array( $this, '_output_css'), 150 );
[393] Fix | Delete
add_action( 'admin_enqueue_scripts',array( $this, '_enqueue_output'), 150 );
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
[397] Fix | Delete
add_action( 'wp_print_scripts', array( $this, 'vc_fixes' ), 100 );
[398] Fix | Delete
add_action( 'admin_enqueue_scripts', array( $this, 'vc_fixes' ), 100 );
[399] Fix | Delete
[400] Fix | Delete
[401] Fix | Delete
if ( $this->args['database'] == "network" && $this->args['network_admin'] ) {
[402] Fix | Delete
add_action( 'network_admin_edit_redux_' . $this->args['opt_name'], array(
[403] Fix | Delete
$this,
[404] Fix | Delete
'save_network_page'
[405] Fix | Delete
), 10, 0 );
[406] Fix | Delete
add_action( 'admin_bar_menu', array( $this, 'network_admin_bar' ), 999 );
[407] Fix | Delete
}
[408] Fix | Delete
// Ajax saving!!!
[409] Fix | Delete
add_action( "wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array( $this, "ajax_save" ) );
[410] Fix | Delete
[411] Fix | Delete
if ( $this->args['dev_mode'] == true || Redux_Helpers::isLocalHost() == true ) {
[412] Fix | Delete
// require_once 'core/dashboard.php';
[413] Fix | Delete
// new reduxDashboardWidget( $this );
[414] Fix | Delete
[415] Fix | Delete
// if ( ! isset ( $GLOBALS['redux_notice_check'] ) ) {
[416] Fix | Delete
// require_once 'core/newsflash.php';
[417] Fix | Delete
//
[418] Fix | Delete
// $params = array(
[419] Fix | Delete
// 'dir_name' => 'notice',
[420] Fix | Delete
// 'server_file' => 'http://reduxframework.com/wp-content/uploads/redux/redux_notice.json',
[421] Fix | Delete
// 'interval' => 3,
[422] Fix | Delete
// 'cookie_id' => 'redux_blast',
[423] Fix | Delete
// );
[424] Fix | Delete
//
[425] Fix | Delete
// new reduxNewsflash( $this, $params );
[426] Fix | Delete
// $GLOBALS['redux_notice_check'] = 1;
[427] Fix | Delete
// }
[428] Fix | Delete
}
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
/**
[432] Fix | Delete
* Loaded hook
[433] Fix | Delete
* action 'redux/loaded'
[434] Fix | Delete
*
[435] Fix | Delete
* @param object $this ReduxFramework
[436] Fix | Delete
*/
[437] Fix | Delete
do_action( 'redux/loaded', $this );
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
// __construct()
[441] Fix | Delete
[442] Fix | Delete
private function set_redux_content() {
[443] Fix | Delete
$upload_dir = wp_upload_dir();
[444] Fix | Delete
self::$_upload_dir = $upload_dir['basedir'] . '/redux/';
[445] Fix | Delete
self::$_upload_url = str_replace( array(
[446] Fix | Delete
'https://',
[447] Fix | Delete
'http://'
[448] Fix | Delete
), '//', $upload_dir['baseurl'] . '/redux/' );
[449] Fix | Delete
}
[450] Fix | Delete
[451] Fix | Delete
private function set_default_args() {
[452] Fix | Delete
$this->args = array(
[453] Fix | Delete
'opt_name' => '',
[454] Fix | Delete
// Must be defined by theme/plugin
[455] Fix | Delete
'google_api_key' => '',
[456] Fix | Delete
// Must be defined to update the google fonts cache for the typography module
[457] Fix | Delete
'google_update_weekly' => false,
[458] Fix | Delete
// Set to keep your google fonts updated weekly
[459] Fix | Delete
'last_tab' => '',
[460] Fix | Delete
// force a specific tab to always show on reload
[461] Fix | Delete
'menu_icon' => '',
[462] Fix | Delete
// menu icon
[463] Fix | Delete
'menu_title' => '',
[464] Fix | Delete
// menu title/text
[465] Fix | Delete
'page_title' => '',
[466] Fix | Delete
// option page title
[467] Fix | Delete
'page_slug' => '',
[468] Fix | Delete
'page_permissions' => 'manage_options',
[469] Fix | Delete
'menu_type' => 'menu',
[470] Fix | Delete
// ('menu'|'submenu')
[471] Fix | Delete
'page_parent' => 'themes.php',
[472] Fix | Delete
// requires menu_type = 'submenu
[473] Fix | Delete
'page_priority' => null,
[474] Fix | Delete
'allow_sub_menu' => true,
[475] Fix | Delete
// allow submenus to be added if menu_type == menu
[476] Fix | Delete
'save_defaults' => true,
[477] Fix | Delete
// Save defaults to the DB on it if empty
[478] Fix | Delete
'footer_credit' => '',
[479] Fix | Delete
'async_typography' => false,
[480] Fix | Delete
'disable_google_fonts_link' => false,
[481] Fix | Delete
'class' => '',
[482] Fix | Delete
// Class that gets appended to all redux-containers
[483] Fix | Delete
'admin_bar' => true,
[484] Fix | Delete
'admin_bar_priority' => 999,
[485] Fix | Delete
// Show the panel pages on the admin bar
[486] Fix | Delete
'admin_bar_icon' => '',
[487] Fix | Delete
// admin bar icon
[488] Fix | Delete
'help_tabs' => array(),
[489] Fix | Delete
'help_sidebar' => '',
[490] Fix | Delete
'database' => '',
[491] Fix | Delete
// possible: options, theme_mods, theme_mods_expanded, transient, network
[492] Fix | Delete
'customizer' => false,
[493] Fix | Delete
// setting to true forces get_theme_mod_expanded
[494] Fix | Delete
'global_variable' => '',
[495] Fix | Delete
// Changes global variable from $GLOBALS['YOUR_OPT_NAME'] to whatever you set here. false disables the global variable
[496] Fix | Delete
'output' => true,
[497] Fix | Delete
// Dynamically generate CSS
[498] Fix | Delete
'compiler' => true,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function