diff --git a/src/wp-includes/widgets/class-wp-widget-tag-cloud.php b/src/wp-includes/widgets/class-wp-widget-tag-cloud.php index 6390ace0f5..26b3fd8717 100644 --- a/src/wp-includes/widgets/class-wp-widget-tag-cloud.php +++ b/src/wp-includes/widgets/class-wp-widget-tag-cloud.php @@ -30,15 +30,6 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } } - /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ - $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); - - echo $args['before_widget']; - if ( $title ) { - echo $args['before_title'] . $title . $args['after_title']; - } - echo '
-
--
get_field_id( 'title' ); + $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 = ''; + + switch ( count( $taxonomies ) ) { + + // No tag cloud supporting taxonomies found, display error message + case 0: + echo '' . __( 'The tag cloud will not be displayed since their are no taxonomies that support the tag cloud widget.' ) . '
'; + printf( $input, '' ); + break; + + // Just a single tag cloud supporting taxonomy found, no need to display options + case 1: + $keys = array_keys( $taxonomies ); + $taxonomy = reset( $keys ); + printf( $input, esc_attr( $taxonomy ) ); + break; + + // More than one tag cloud supporting taxonomy found, display options + default: + printf( + '' . + '
'; + } } /**