summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/categories.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/blocks/categories.php')
-rw-r--r--wp-includes/blocks/categories.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/wp-includes/blocks/categories.php b/wp-includes/blocks/categories.php
index 7e3979b..c353765 100644
--- a/wp-includes/blocks/categories.php
+++ b/wp-includes/blocks/categories.php
@@ -70,8 +70,7 @@ function render_block_core_categories( $attributes ) {
function build_dropdown_script_block_core_categories( $dropdown_id ) {
ob_start();
?>
- <script type='text/javascript'>
- /* <![CDATA[ */
+ <script>
( function() {
var dropdown = document.getElementById( '<?php echo esc_js( $dropdown_id ); ?>' );
function onCatChange() {
@@ -81,10 +80,9 @@ function build_dropdown_script_block_core_categories( $dropdown_id ) {
}
dropdown.onchange = onCatChange;
})();
- /* ]]> */
</script>
<?php
- return ob_get_clean();
+ return wp_get_inline_script_tag( str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) );
}
/**