simplified ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS
This commit is contained in:
parent
1e7e6bba28
commit
6992fbbe22
1 changed files with 15 additions and 17 deletions
|
@ -82,7 +82,7 @@ class Post {
|
||||||
|
|
||||||
// max images can't be negative or zero
|
// max images can't be negative or zero
|
||||||
if ( $max_images <= 0 ) {
|
if ( $max_images <= 0 ) {
|
||||||
$max_images = 1;
|
return $images;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->post->ID;
|
$id = $this->post->ID;
|
||||||
|
@ -94,7 +94,6 @@ class Post {
|
||||||
$max_images--;
|
$max_images--;
|
||||||
}
|
}
|
||||||
// then list any image attachments
|
// then list any image attachments
|
||||||
if ( $max_images > 0 ) {
|
|
||||||
$query = new \WP_Query(
|
$query = new \WP_Query(
|
||||||
array(
|
array(
|
||||||
'post_parent' => $id,
|
'post_parent' => $id,
|
||||||
|
@ -111,7 +110,6 @@ class Post {
|
||||||
$image_ids[] = $attachment->ID;
|
$image_ids[] = $attachment->ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$image_ids = \array_unique( $image_ids );
|
$image_ids = \array_unique( $image_ids );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue