PostListArgs final class
Minn\Rest\PostListArgs · public/minn/src/Minn/Rest/PostListArgs.php · 171 lines
The WP_Query arguments a post list request makes, as the reference makes them before rest_{type}_query (probe rest-post-lists): each registered parameter the request carries under its query name, the date bounds, per_page, stickies (only them, or none of them), an exact search, each taxonomy's include and exclude under the request's relation, formats (standard as no format at all), the type, and ids alone for a HEAD request. Then each through rest_query_var-{name}, the orderby names mapped to the query's, and stickies left where they fall unless asked.
Constants and properties
| private | MAPPINGS = array ( 'author' => 'author__in', 'author_exclude' => 'author__not_in', 'exclude' => 'post__not_in', 'include' => 'post__in', 'ignore_sticky' => 'ignore_sticky_posts', 'menu_order' => 'menu_order', 'offset' => 'offset', 'order' => 'order', 'orderby' => 'orderby', 'page' => 'paged', 'parent' => 'post_parent__in', 'parent_exclude' => 'post_parent__not_in', 'search' => 's', 'search_columns' => 'search_columns', 'slug' => 'post_name__in', 'status' => 'post_status', ) | |
| private | DATES = array ( 0 => array ( 0 => 'before', 1 => 'before', 2 => 'post_date', ), 1 => array ( 0 => 'modified_before', 1 => 'before', 2 => 'post_modified', ), 2 => array ( 0 => 'after', 1 => 'after', 2 => 'post_date', ), 3 => array ( 0 => 'modified_after', 1 => 'after', 2 => 'post_modified', ), ) | |
| private | ORDERBY = array ( 'id' => 'ID', 'include' => 'post__in', 'slug' => 'post_name', 'include_slugs' => 'post_name__in', ) | |
| private | IN = 'post__in' | |
| private | NOT_IN = 'post__not_in' |
Public
| static | of(WP_REST_Request $request, array $registered, string $type): array# | The arguments before plugins see them.
@return array<string, mixed> | |||
| static | queryVars(array $args, WP_REST_Request $request): array# | The query variables from the arguments plugins left: each through rest_query_var-{name}, and the list's orderby names as the query's.
@return array<string, mixed> |
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | mimeTypes(array $vars, WP_REST_Request $request): array# | A media list's MIME types, set after plugins have seen the query: the MIME types asked for (those the site allows), else every one of the media types asked for.
@return array<string, mixed> | ||||||
| private | sticky(array $args, bool $only): array# | Only sticky posts (those among the ids asked for), or none of them. @param array<string, mixed> $args @return array<string, mixed>
| ||||||
| private | taxonomies(array $args, WP_REST_Request $request, string $type): array# | Each REST taxonomy's include (ids, or a query with children and an operator) and exclude, under the request's relation. @param array<string, mixed> $args @return array<string, mixed>
| ||||||
| private | termClause(mixed $given, string $operator): ?array# | One term filter as a clause: its terms, whether children count, and its operator (an include may ask for all). @return array<string, mixed>|null @return array<string, mixed>|null | ||||||
| private | formats(array $args, array $formats): array# | Formats as an OR of their terms, standard as no format at all; beside other term filters, a group of their own.
@return array<string, mixed> |
Nothing matches.