add_section( 'live_css_edit_section', array( 'priority' => 11, 'capability' => 'edit_theme_options', 'title' => __( 'CSS Editor', 'customify' ), ) ); $saving_type = PixCustomifyPlugin::get_plugin_option( 'values_store_mod', 'option' ); $wp_customize->add_setting( 'live_css_edit', array( 'type' => $saving_type, 'label' => __( 'CSS Editor', 'customify' ), 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'default' => __( "/* * Welcome to the Custom CSS Editor * * CSS (Cascading Style Sheets) is a language that helps * the browser render your website. You may remove these * lines and get started with your own customizations. * * The generated code will be placed after the theme * stylesheets, which means that your rules can take * precedence and override the theme CSS rules. Just * write here what you want to change, you don't need * to copy all your theme's stylesheet content. * * Getting started with CSS (tutorial): * http://bit.ly/css-getting-started */ /* An example of a Custom CSS Snippet */ selector { color: green; }", 'customify' ) ) ); $this_control = new Pix_Customize_CSS_Editor_Control( $wp_customize, 'live_css_edit_control', array( 'label' => __( 'Edit Live Css', 'customify' ), 'section' => 'live_css_edit_section', 'settings' => 'live_css_edit', ) ); $wp_customize->add_control( $this_control ); } function output_dynamic_style() { // Allow others to short-circuit us if ( ! apply_filters( 'customify_css_live_editor_enabled', true ) ) { return; } $store_type = PixCustomifyPlugin::get_plugin_option( 'values_store_mod', 'option' ); if ( $store_type === 'option' ) { $output = get_option( 'live_css_edit' ); } elseif ( $store_type === 'theme_mod' ) { $output = get_theme_mod( 'live_css_edit' ); } if ( empty( $output ) ) { return; } ?> =' ) ) { return false; } return $enabled; } } $customify_CSS_Editor = Customify_CSS_Live_Editor::get_instance();