Changeset 41558 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 09/21/2017 11:03:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r41550 r41558 214 214 215 215 /** 216 * Code Editor Settings for Custom CSS.217 *218 * This variable contains the settings returned by `wp_enqueue_code_editor()` which are then later output219 * to the client in `WP_Customize_Manager::customize_pane_settings()`. A value of false means that the220 * Custom CSS section or control was removed, or that the Syntax Highlighting user pref was turned off.221 *222 * @see wp_enqueue_code_editor()223 * @see WP_Customize_Manager::enqueue_control_scripts()224 * @see WP_Customize_Manager::customize_pane_settings()225 * @since 4.9.0226 * @var array|false227 */228 private $_custom_css_code_editor_settings = false;229 230 /**231 216 * Constructor. 232 217 * … … 292 277 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); 293 278 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); 279 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-code-editor-control.php' ); 294 280 require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); 295 281 require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' ); … … 3338 3324 $control->enqueue(); 3339 3325 } 3340 3341 if ( $this->get_section( 'custom_css' ) && $this->get_control( 'custom_css' ) ) {3342 $this->_custom_css_code_editor_settings = wp_enqueue_code_editor( array(3343 'type' => 'text/css',3344 ) );3345 }3346 3326 } 3347 3327 … … 3600 3580 'stylesheet' => $this->get_stylesheet(), 3601 3581 'active' => $this->is_theme_active(), 3602 ),3603 'customCss' => array(3604 'codeEditor' => $this->_custom_css_code_editor_settings,3605 3582 ), 3606 3583 'url' => array( … … 3737 3714 $this->register_control_type( 'WP_Customize_Site_Icon_Control' ); 3738 3715 $this->register_control_type( 'WP_Customize_Theme_Control' ); 3716 $this->register_control_type( 'WP_Customize_Code_Editor_Control' ); 3739 3717 3740 3718 /* Themes */ … … 4240 4218 $this->add_setting( $custom_css_setting ); 4241 4219 4242 $this->add_control( 'custom_css', array( 4243 'type' => 'textarea', 4220 $this->add_control( new WP_Customize_Code_Editor_Control( $this, 'custom_css', array( 4244 4221 'section' => 'custom_css', 4245 4222 'settings' => array( 'default' => $custom_css_setting->id ), 4246 'input_attrs' => array( 4247 'class' => 'code', // Ensures contents displayed as LTR instead of RTL. 4248 ), 4249 ) ); 4223 'code_type' => 'text/css', 4224 ) ) ); 4250 4225 } 4251 4226
Note: See TracChangeset
for help on using the changeset viewer.