1
get_posts('post_type=post&numberposts=-1')

and the

get_posts( array(
'post_type'    => 'post',
'posts_per_page' => -1
) );

Are they the same?

1 Answer 1

1

Yes they are, the first form is internally converted into the second. IMO you should not use the first form as it is a relic to the days wordpress DB structure was much simpler. Today I am not sure if you can even achieve all the things you can do with the second form by using the first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.