| @@ -16,11 +16,8 @@ | ||
| 16 | 16 | add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_admin_customizer_styles' ), 10); |
| 17 | 17 | |
| 18 | 18 | $load_location = PixCustomifyPlugin::get_plugin_option( 'style_resources_location', 'wp_head' ); |
| 19 | 19 | add_action( $load_location, array( $this, 'output_dynamic_style' ), 999999999 ); |
| 20 | - | |
| 21 | - //Check the WordPress version and if there are known problems disable it | |
| 22 | - add_filter( 'customify_css_live_editor_enabled', array( $this, 'disable_if_wp_incompatible' ), 10, 1 ); | |
| 23 | 20 | } |
| 24 | 21 | |
| 25 | 22 | /** |
| 26 | 23 | * Return an instance of this class. |
| @@ -47,12 +44,8 @@ | ||
| 47 | 44 | |
| 48 | 45 | } |
| 49 | 46 | |
| 50 | 47 | function cle_create_custom_control( $wp_customize ) { |
| 51 | - // Allow others to short-circuit us | |
| 52 | - if ( ! apply_filters( 'customify_css_live_editor_enabled', true ) ) { | |
| 53 | - return; | |
| 54 | - } | |
| 55 | 48 | |
| 56 | 49 | $wp_customize->add_section( 'live_css_edit_section', array( |
| 57 | 50 | 'priority' => 11, |
| 58 | 51 | 'capability' => 'edit_theme_options', |
| @@ -101,13 +94,8 @@ | ||
| 101 | 94 | $wp_customize->add_control( $this_control ); |
| 102 | 95 | } |
| 103 | 96 | |
| 104 | 97 | function output_dynamic_style() { |
| 105 | - // Allow others to short-circuit us | |
| 106 | - if ( ! apply_filters( 'customify_css_live_editor_enabled', true ) ) { | |
| 107 | - return; | |
| 108 | - } | |
| 109 | - | |
| 110 | 98 | $store_type = PixCustomifyPlugin::get_plugin_option( 'values_store_mod', 'option' ); |
| 111 | 99 | if ( $store_type === 'option' ) { |
| 112 | 100 | $output = get_option( 'live_css_edit' ); |
| 113 | 101 | } elseif ( $store_type === 'theme_mod' ) { |
| @@ -121,22 +109,8 @@ | ||
| 121 | 109 | <?php echo $output; ?> |
| 122 | 110 | </style> |
| 123 | 111 | <?php |
| 124 | 112 | } |
| 125 | - | |
| 126 | - function disable_if_wp_incompatible( $enabled ) { | |
| 127 | - global $wp_version; | |
| 128 | - | |
| 129 | - // WordPress 4.7 introduced a Customizer CSS editor that conflicts with our own | |
| 130 | - // It's best to leave only the one in core | |
| 131 | - // So only load our CSS editor for WP version smaller than 4.7 | |
| 132 | - // We use 4.6.9 to catch the release candidates also | |
| 133 | - if ( version_compare( $wp_version, '4.6.9', '>=' ) ) { | |
| 134 | - return false; | |
| 135 | - } | |
| 136 | - | |
| 137 | - return $enabled; | |
| 138 | - } | |
| 139 | 113 | } |
| 140 | 114 | |
| 141 | 115 | $customify_CSS_Editor = Customify_CSS_Live_Editor::get_instance(); |
| 142 | 116 | |