File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
plugins/image-prioritizer Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -170,11 +170,13 @@ static function ( $host ) {
170
170
// Obtain the host of an image attachment's URL in case a CDN is pointing all images to an origin other than the home or site URLs.
171
171
$ image_attachment_query = new WP_Query (
172
172
array (
173
- 'post_type ' => 'attachment ' ,
174
- 'post_mime_type ' => 'image ' ,
175
- 'post_status ' => 'inherit ' ,
176
- 'posts_per_page ' => 1 ,
177
- 'fields ' => 'ids ' ,
173
+ 'post_type ' => 'attachment ' ,
174
+ 'post_mime_type ' => 'image ' ,
175
+ 'post_status ' => 'inherit ' ,
176
+ 'posts_per_page ' => 1 ,
177
+ 'fields ' => 'ids ' ,
178
+ 'no_found_rows ' => true ,
179
+ 'update_post_term_cache ' => false , // Note that update_post_meta_cache is not included as well because wp_get_attachment_image_src() needs postmeta.
178
180
)
179
181
);
180
182
if ( isset ( $ image_attachment_query ->posts [0 ] ) && is_int ( $ image_attachment_query ->posts [0 ] ) ) {
You can’t perform that action at this time.
0 commit comments