diff --git src/wp-includes/widgets/class-wp-widget-media-gallery.php src/wp-includes/widgets/class-wp-widget-media-gallery.php
index 13ee9c2d6e..40cbfa2be7 100644
|
|
|
class WP_Widget_Media_Gallery extends WP_Widget_Media { |
| 109 | 109 | $instance, |
| 110 | 110 | array( |
| 111 | 111 | 'link' => $instance['link_type'], |
| | 112 | 'id' => is_singular() ? get_queried_object_id() : 0, |
| 112 | 113 | ) |
| 113 | 114 | ); |
| 114 | 115 | |
| … |
… |
class WP_Widget_Media_Gallery extends WP_Widget_Media { |
| 223 | 224 | } |
| 224 | 225 | } |
| 225 | 226 | return true; |
| | 227 | } elseif ( is_singular() ) { |
| | 228 | $children = get_children( array( |
| | 229 | 'id' => get_queried_object_id(), |
| | 230 | 'post_status' => 'inherit', |
| | 231 | 'post_type' => 'attachment', |
| | 232 | 'post_mime_type' => 'image', |
| | 233 | ) ); |
| | 234 | if ( ! empty( $children ) ) { |
| | 235 | return true; |
| | 236 | } |
| 226 | 237 | } |
| 227 | 238 | return false; |
| 228 | 239 | } |