WP_Widget_Custom_HTML::render_control_template_scripts() WordPress Method
The WP_Widget_Custom_HTML::render_control_template_scripts() method is used to render the control template scripts. This method is called in the wp_print_scripts() action.
WP_Widget_Custom_HTML::render_control_template_scripts() #
Render form template scripts.
Source
File: wp-includes/widgets/class-wp-widget-custom-html.php
public static function render_control_template_scripts() { ?> <script type="text/html" id="tmpl-widget-custom-html-control-fields"> <# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\D/g, '' ) + '_' #> <p> <label for="{{ elementIdPrefix }}title"><?php esc_html_e( 'Title:' ); ?></label> <input id="{{ elementIdPrefix }}title" type="text" class="widefat title"> </p> <p> <label for="{{ elementIdPrefix }}content" id="{{ elementIdPrefix }}content-label"><?php esc_html_e( 'Content:' ); ?></label> <textarea id="{{ elementIdPrefix }}content" class="widefat code content" rows="16" cols="20"></textarea> </p> <?php if ( ! current_user_can( 'unfiltered_html' ) ) : ?> <?php $probably_unsafe_html = array( 'script', 'iframe', 'form', 'input', 'style' ); $allowed_html = wp_kses_allowed_html( 'post' ); $disallowed_html = array_diff( $probably_unsafe_html, array_keys( $allowed_html ) ); ?> <?php if ( ! empty( $disallowed_html ) ) : ?> <# if ( data.codeEditorDisabled ) { #> <p> <?php _e( 'Some HTML tags are not permitted, including:' ); ?> <code><?php echo implode( '</code>, <code>', $disallowed_html ); ?></code> </p> <# } #> <?php endif; ?> <?php endif; ?> <div class="code-editor-error-container"></div> </script> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |