equal
deleted
inserted
replaced
246 * @return bool Whether widget has content. |
246 * @return bool Whether widget has content. |
247 */ |
247 */ |
248 protected function has_content( $instance ) { |
248 protected function has_content( $instance ) { |
249 if ( ! empty( $instance['ids'] ) ) { |
249 if ( ! empty( $instance['ids'] ) ) { |
250 $attachments = wp_parse_id_list( $instance['ids'] ); |
250 $attachments = wp_parse_id_list( $instance['ids'] ); |
|
251 // Prime attachment post caches. |
|
252 _prime_post_caches( $attachments, false, false ); |
251 foreach ( $attachments as $attachment ) { |
253 foreach ( $attachments as $attachment ) { |
252 if ( 'attachment' !== get_post_type( $attachment ) ) { |
254 if ( 'attachment' !== get_post_type( $attachment ) ) { |
253 return false; |
255 return false; |
254 } |
256 } |
255 } |
257 } |