WP_Customize_Code_Editor_Control::content_template() WordPress Method
The WP_Customize_Code_Editor_Control::content_template() method is used to output the control content in the Customizer.
WP_Customize_Code_Editor_Control::content_template() #
Render a JS template for control display.
Source
File: wp-includes/customize/class-wp-customize-code-editor-control.php
public function content_template() {
?>
<# var elementIdPrefix = 'el' + String( Math.random() ); #>
<# if ( data.label ) { #>
<label for="{{ elementIdPrefix }}_editor" class="customize-control-title">
{{ data.label }}
</label>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-notifications-container"></div>
<textarea id="{{ elementIdPrefix }}_editor"
<# _.each( _.extend( { 'class': 'code' }, data.input_attrs ), function( value, key ) { #>
{{{ key }}}="{{ value }}"
<# }); #>
></textarea>
<?php
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |