File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ public function posts() {
140140 private function calculate_post_ids () {
141141 global $ wpdb ;
142142 if ( is_array ( $ this ->filters ['post_ids ' ] ) ) {
143+ if ( getenv ( 'WP_WITH_ATTACHMENT ' ) ) {
144+ $ attachment_post_ids = $ this ->attachments_for_specific_post_types ( $ this ->filters ['post_ids ' ] );
145+ $ this ->filters ['post_ids ' ] = array_merge ( $ this ->filters ['post_ids ' ], $ attachment_post_ids );
146+ }
143147 return $ this ->filters ['post_ids ' ];
144148 }
145149 $ this ->post_type_where ();
@@ -262,7 +266,7 @@ private function category_where() {
262266
263267 private function attachments_for_specific_post_types ( $ post_ids ) {
264268 global $ wpdb ;
265- if ( !$ this -> filters [ ' post_type ' ] ) {
269+ if ( ! $ post_ids ) {
266270 return array ();
267271 }
268272 $ attachment_ids = array ();
You can’t perform that action at this time.
0 commit comments