Skip to main content
added the requested explanation of why post_status is needed.
Source Link

Add in $args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

This is important because attachments don't have a post_status, so the default value for post_status, published, will find no attachments.

Add in $args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

Add in $args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

This is important because attachments don't have a post_status, so the default value for post_status, published, will find no attachments.

general edit
Source Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

Add in args$args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

Add in args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

Add in $args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

addAdd in argsargs, it is important.

'post_status' => 'any'

do not:Do not: 'post_status' => null

add in args, it is important.

'post_status' => 'any'

do not: 'post_status' => null

Add in args, it is important.

'post_status' => 'any'

Do not: 'post_status' => null

Source Link
Pham
  • 301
  • 2
  • 2
Loading