Core Function
View Source on Trac ↗ get_posts()
get_posts( mixed $args = null ) Retrieves an array of the latest posts, or posts matching the given criteria.
Parameters 1 required
| Name / Type | Description |
|---|---|
| array | $args { Optional. Arguments to retrieve posts. See WP_Query::parse_query() for all available arguments. Required |
Return Value
((WP_Post[])
| int[]) Array of post objects or post IDs.
Function Information
Since Version
1.2.0
Source File
wp-includes/post.php
Advertisement