Documentation

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
self

find()

public find(int $id) : WP_Post|null
Parameters
$id : int
Return values
WP_Post|null

first()

public first() : WP_Post|null
Return values
WP_Post|null

get()

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
self

metaRelation()

public metaRelation(string $relation) : self
Parameters
$relation : string
Return values
self

metaWhere()

public metaWhere(string $key, mixed $value[, string $compare = '=' ][, string $type = 'CHAR' ]) : self
Parameters
$key : string
$value : mixed
$compare : string = '='
$type : string = 'CHAR'
Return values
self

metaWhereExists()

public metaWhereExists(string $key) : self
Parameters
$key : string
Return values
self

noFoundRows()

public noFoundRows() : self
Return values
self

offset()

public offset(int $offset) : self
Parameters
$offset : int
Return values
self

orderBy()

public orderBy(string $field[, string $direction = 'ASC' ]) : self
Parameters
$field : string
$direction : string = 'ASC'
Return values
self

orderByMeta()

public orderByMeta(string $metaKey[, string $direction = 'ASC' ][, string $type = 'CHAR' ]) : self
Parameters
$metaKey : string
$direction : string = 'ASC'
$type : string = 'CHAR'
Return values
self

page()

public page(int $page) : self
Parameters
$page : int
Return values
self

paginate()

public paginate() : array<string|int, mixed>
Return values
array<string|int, mixed>

parent()

public parent(int $parentId) : self
Parameters
$parentId : int
Return values
self

postType()

public postType(string $type) : self
Parameters
$type : string
Return values
self
public search(string $term) : self
Parameters
$term : string
Return values
self

status()

public status(array<string|int, mixed>|string $status) : self
Parameters
$status : array<string|int, mixed>|string
Return values
self

toArgs()

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
self

withFoundRows()

public withFoundRows() : self
Return values
self
On this page

Search results