Remove possibe superfluous wp_attachment_is_image() filter.

The reason to remove this is that this function uses get_post() under
the hood which always assumes the attachment is on the same site, where
as if you're using a plugin such as
https://github.com/humanmade/network-media-library it might not be.

I'm not sure if there's any adverse affects of not doing this filtering,
from my testing, it still seems to work in the same way.
This commit is contained in:
Ian Jenkins 2019-01-25 15:11:58 +00:00
parent 00a93ae8f0
commit d7e32e1c77
1 changed files with 0 additions and 4 deletions

View File

@ -1257,10 +1257,6 @@ class WC_Product extends WC_Abstract_Legacy_Product {
public function set_gallery_image_ids( $image_ids ) {
$image_ids = wp_parse_id_list( $image_ids );
if ( $this->get_object_read() ) {
$image_ids = array_filter( $image_ids, 'wp_attachment_is_image' );
}
$this->set_prop( 'gallery_image_ids', $image_ids );
}