diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/widgets/class-wp-widget-tag-cloud.php --- a/wp/wp-includes/widgets/class-wp-widget-tag-cloud.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-tag-cloud.php Tue Dec 15 13:49:49 2020 +0100 @@ -54,19 +54,19 @@ $show_count = ! empty( $instance['count'] ); - /** - * Filters the taxonomy used in the Tag Cloud widget. - * - * @since 2.8.0 - * @since 3.0.0 Added taxonomy drop-down. - * @since 4.9.0 Added the `$instance` parameter. - * - * @see wp_tag_cloud() - * - * @param array $args Args used for the tag cloud widget. - * @param array $instance Array of settings for the current widget. - */ $tag_cloud = wp_tag_cloud( + /** + * Filters the taxonomy used in the Tag Cloud widget. + * + * @since 2.8.0 + * @since 3.0.0 Added taxonomy drop-down. + * @since 4.9.0 Added the `$instance` parameter. + * + * @see wp_tag_cloud() + * + * @param array $args Args used for the tag cloud widget. + * @param array $instance Array of settings for the current widget. + */ apply_filters( 'widget_tag_cloud_args', array( @@ -124,64 +124,61 @@ * @param array $instance Current settings. */ public function form( $instance ) { - $current_taxonomy = $this->_get_current_taxonomy( $instance ); - $title_id = $this->get_field_id( 'title' ); - $count = isset( $instance['count'] ) ? (bool) $instance['count'] : false; - $instance['title'] = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; - - echo '

- -

'; - - $taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'object' ); - $id = $this->get_field_id( 'taxonomy' ); - $name = $this->get_field_name( 'taxonomy' ); - $input = ''; - - $count_checkbox = sprintf( - '

', - $this->get_field_id( 'count' ), - $this->get_field_name( 'count' ), - checked( $count, true, false ), - __( 'Show tag counts' ) - ); + $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; + $count = isset( $instance['count'] ) ? (bool) $instance['count'] : false; + ?> +

+ + +

+ true ), 'object' ); + $current_taxonomy = $this->_get_current_taxonomy( $instance ); switch ( count( $taxonomies ) ) { - // No tag cloud supporting taxonomies found, display error message + // No tag cloud supporting taxonomies found, display error message. case 0: - echo '

' . __( 'The tag cloud will not be displayed since there are no taxonomies that support the tag cloud widget.' ) . '

'; - printf( $input, '' ); + ?> + +

+ +

+ + + ' . - ' + $tax ) : ?> + + + +

+ $tax ) { - printf( - '', - esc_attr( $taxonomy ), - selected( $taxonomy, $current_taxonomy, false ), - $tax->labels->name - ); - } - - echo '

' . $count_checkbox; + if ( count( $taxonomies ) > 0 ) { + ?> +

+ /> + +

+