They are all the same and does exactly the same thing. Usage are slightly different though
- `numberposts`, `posts_per_page` and `showposts` are all valid in [`get_posts()`][1]. `numberposts` is set to `posts_per_page` before being passed to `WP_Query`. Check the source code
if ( ! empty($r['numberposts']) && empty($r['posts_per_page']) )
$r['posts_per_page'] = $r['numberposts'];
- `posts_per_page` and `showposts` are all valid in `WP_Query` but `numberposts` not. If `showposts` is used, it is set to `posts_per_page` in the `WP_Query` class. See the source code
if ( isset($q['showposts']) && $q['showposts'] ) {
$q['showposts'] = (int) $q['showposts'];
$q['posts_per_page'] = $q['showposts'];
}
Although the codex says `showposts` is depreciated, there is still no depreciation notice in core.It was however replaced in favor of `posts_per_page`.
To answer your question, `posts_per_page` is probably the best to use as `numberposts` and `showposts` are being set to `posts_per_page` in the `WP_Query` class
[1]:
[To see links please register here]