summaryrefslogtreecommitdiffstatshomepage
path: root/src/wp-includes/widgets/class-wp-widget-categories.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/wp-includes/widgets/class-wp-widget-categories.php')
-rw-r--r--src/wp-includes/widgets/class-wp-widget-categories.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wp-includes/widgets/class-wp-widget-categories.php b/src/wp-includes/widgets/class-wp-widget-categories.php
index 3c009709ba..e00ce7f960 100644
--- a/src/wp-includes/widgets/class-wp-widget-categories.php
+++ b/src/wp-includes/widgets/class-wp-widget-categories.php
@@ -92,11 +92,10 @@ class WP_Widget_Categories extends WP_Widget {
echo '</form>';
- $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
+ ob_start();
?>
-<script<?php echo $type_attr; ?>>
-/* <![CDATA[ */
+<script>
(function() {
var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" );
function onCatChange() {
@@ -106,10 +105,10 @@ class WP_Widget_Categories extends WP_Widget {
}
dropdown.onchange = onCatChange;
})();
-/* ]]> */
</script>
<?php
+ wp_print_inline_script_tag( str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) );
} else {
$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';