QueryBuilder
in package
FinalYes
Table of Contents
Properties
- $args : array<string|int, mixed>
Methods
- author() : self
- count() : int
- find() : WP_Post|null
- first() : WP_Post|null
- get() : array<string|int, mixed>
- ids() : array<string|int, mixed>
- limit() : self
- metaRelation() : self
- metaWhere() : self
- metaWhereExists() : self
- noFoundRows() : self
- offset() : self
- orderBy() : self
- orderByMeta() : self
- page() : self
- paginate() : array<string|int, mixed>
- parent() : self
- postType() : self
- search() : self
- status() : self
- toArgs() : array<string|int, mixed>
- whereIn() : self
- withFoundRows() : self
Properties
$args
private
array<string|int, mixed>
$args
= ['post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 20, 'orderby' => 'date', 'order' => 'DESC', 'meta_query' => [], 'no_found_rows' => false]
Methods
author()
public
author(int $userId) : self
Parameters
- $userId : int
Return values
selfcount()
public
count() : int
Return values
intfind()
public
find(int $id) : WP_Post|null
Parameters
- $id : int
Return values
WP_Post|nullfirst()
public
first() : WP_Post|null
Return values
WP_Post|nullget()
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed>ids()
public
ids() : array<string|int, mixed>
Return values
array<string|int, mixed>limit()
public
limit(int $count) : self
Parameters
- $count : int
Return values
selfmetaRelation()
public
metaRelation(string $relation) : self
Parameters
- $relation : string
Return values
selfmetaWhere()
public
metaWhere(string $key, mixed $value[, string $compare = '=' ][, string $type = 'CHAR' ]) : self
Parameters
- $key : string
- $value : mixed
- $compare : string = '='
- $type : string = 'CHAR'
Return values
selfmetaWhereExists()
public
metaWhereExists(string $key) : self
Parameters
- $key : string
Return values
selfnoFoundRows()
public
noFoundRows() : self
Return values
selfoffset()
public
offset(int $offset) : self
Parameters
- $offset : int
Return values
selforderBy()
public
orderBy(string $field[, string $direction = 'ASC' ]) : self
Parameters
- $field : string
- $direction : string = 'ASC'
Return values
selforderByMeta()
public
orderByMeta(string $metaKey[, string $direction = 'ASC' ][, string $type = 'CHAR' ]) : self
Parameters
- $metaKey : string
- $direction : string = 'ASC'
- $type : string = 'CHAR'
Return values
selfpage()
public
page(int $page) : self
Parameters
- $page : int
Return values
selfpaginate()
public
paginate() : array<string|int, mixed>
Return values
array<string|int, mixed>parent()
public
parent(int $parentId) : self
Parameters
- $parentId : int
Return values
selfpostType()
public
postType(string $type) : self
Parameters
- $type : string
Return values
selfsearch()
public
search(string $term) : self
Parameters
- $term : string
Return values
selfstatus()
public
status(array<string|int, mixed>|string $status) : self
Parameters
- $status : array<string|int, mixed>|string
Return values
selftoArgs()
public
toArgs() : array<string|int, mixed>
Return values
array<string|int, mixed>whereIn()
public
whereIn(array<string|int, mixed> $ids) : self
Parameters
- $ids : array<string|int, mixed>
Return values
selfwithFoundRows()
public
withFoundRows() : self