Ejemplo n.º 1
0
 /**
  * Set default options on admin_init if option doesn't exist
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 private function _default_cleanup()
 {
     // Fix the global variable name
     if ($this->args['global_variable'] == "" && $this->args['global_variable'] !== false) {
         $this->args['global_variable'] = str_replace('-', '_', $this->args['opt_name']);
     }
     // Force dev_mode on WP_DEBUG = true and if it's a local server
     if (AvadaRedux_Helpers::isLocalHost() || AvadaRedux_Helpers::isWpDebug()) {
         if ($this->args['dev_mode'] != true) {
             $this->args['update_notice'] = false;
         }
         $this->dev_mode_forced = true;
         $this->args['dev_mode'] = true;
         // if ( isset( $this->args['forced_dev_mode_off'] ) && $this->args['forced_dev_mode_off'] == true ) {
         // 	$this->dev_mode_forced  = false;
         // 	$this->args['dev_mode'] = false;
         // }
     }
     // Auto create the page_slug appropriately
     if (empty($this->args['page_slug'])) {
         if (!empty($this->args['display_name'])) {
             $this->args['page_slug'] = sanitize_html_class($this->args['display_name']);
         } else {
             if (!empty($this->args['page_title'])) {
                 $this->args['page_slug'] = sanitize_html_class($this->args['page_title']);
             } else {
                 if (!empty($this->args['menu_title'])) {
                     $this->args['page_slug'] = sanitize_html_class($this->args['menu_title']);
                 } else {
                     $this->args['page_slug'] = str_replace('-', '_', $this->args['opt_name']);
                 }
             }
         }
     }
     if (isset($this->args['customizer_only']) && $this->args['customizer_only'] == true) {
         $this->args['menu_type'] = 'hidden';
         $this->args['customizer'] = true;
         $this->args['admin_bar'] = false;
         $this->args['allow_sub_menu'] = false;
     }
     // Check if the Airplane Mode plugin is installed
     if (class_exists('Airplane_Mode_Core')) {
         $airplane = Airplane_Mode_Core::getInstance();
         if (method_exists($airplane, 'enabled')) {
             if ($airplane->enabled()) {
                 $this->args['use_cdn'] = false;
             }
         } else {
             if ($airplane->check_status() == 'on') {
                 $this->args['use_cdn'] = false;
             }
         }
     }
 }
Ejemplo n.º 2
0
<?php

/**
 * The template for the panel header area.
 * Override this template by specifying the path where it is stored (templates_path) in your AvadaRedux config.
 *
 * @author      AvadaRedux Framework
 * @package     AvadaReduxFramework/Templates
 * @version:    3.5.4.18
 */
$tip_title = __('Developer Mode Enabled', 'avadaredux-framework');
if ($this->parent->dev_mode_forced) {
    $is_debug = false;
    $is_localhost = false;
    $debug_bit = '';
    if (AvadaRedux_Helpers::isWpDebug()) {
        $is_debug = true;
        $debug_bit = __('WP_DEBUG is enabled', 'avadaredux-framework');
    }
    $localhost_bit = '';
    if (AvadaRedux_Helpers::isLocalHost()) {
        $is_localhost = true;
        $localhost_bit = __('you are working in a localhost environment', 'avadaredux-framework');
    }
    $conjunction_bit = '';
    if ($is_localhost && $is_debug) {
        $conjunction_bit = ' ' . __('and', 'avadaredux-framework') . ' ';
    }
    $tip_msg = __('This has been automatically enabled because', 'avadaredux-framework') . ' ' . $debug_bit . $conjunction_bit . $localhost_bit . '.';
} else {
    $tip_msg = __('If you are not a developer, your theme/plugin author shipped with developer mode enabled. Contact them directly to fix it.', 'avadaredux-framework');