Question

Does the post__not_in parameter can have multiple arrays for excluding, for example, sticky posts and also the IDs of some other posts?

Something like:

'post__not_in' => array(
   get_option( 'sticky_posts' ),
   array( 1, 2, 3 )
)
Était-ce utile?

La solution

No, it doesn't. You'd just merge the arrays:

'post__not_in' => array(
    array_merge( get_option( 'sticky_posts' ), array( 1, 2, 3 ) ),
)

And just because someone else will mention it if I don't: post__not_in has terrible performance and you'd be better off finding an alternate solution.

Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange
scroll top