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

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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