Grid_Query extends Table_Query

Handles the query for a Document_Grid;

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

$args  : mixed
$current_page  : mixed
$max_num_pages  : mixed
$posts  : mixed
$total_filtered_posts  : mixed
$total_posts  : mixed
__construct()  : mixed
Constructor.
filter_wp_posts_selected_columns()  : mixed
Filter the wp_posts columns for the query.
get_current_page()  : int|string
Get the current page.
get_max_num_pages()  : int|string
Get the total number of pages.
get_posts()  : mixed
get_total_filtered_posts()  : mixed
get_total_posts()  : mixed
is_filtered_frontend()  : mixed
Is the query filtered by the user on the frontend.
set_posts()  : mixed
set_total_filtered_posts()  : mixed
set_total_posts()  : mixed
add_query_hooks()  : mixed
add_user_search_args()  : mixed
array_map_prefix_column()  : string
Array map callback to prefix column.
build_base_posts_query()  : mixed
build_meta_query()  : mixed
build_post_totals_query()  : mixed
build_posts_query()  : mixed
build_search_filters_tax_query()  : mixed
build_tax_query()  : mixed
check_within_post_limit()  : mixed
get_order_by()  : mixed
maybe_add_relation()  : mixed
maybe_nest_query()  : mixed
remove_query_hooks()  : mixed
run_posts_query()  : mixed
tax_query_item()  : array<string|int, mixed>
Generate an inner array for the 'tax_query' arg in WP_Query.

Properties

$current_page

private mixed $current_page = null

$max_num_pages

private mixed $max_num_pages = null

$total_filtered_posts

private mixed $total_filtered_posts = null

Methods

__construct()

Constructor.

public __construct(mixed $args) : mixed
Parameters
$args : mixed
Return values
mixed

filter_wp_posts_selected_columns()

Filter the wp_posts columns for the query.

public filter_wp_posts_selected_columns(mixed $fields, mixed $query) : mixed
Parameters
$fields : mixed
$query : mixed
Return values
mixed

get_current_page()

Get the current page.

public get_current_page() : int|string
Return values
int|string

get_max_num_pages()

Get the total number of pages.

public get_max_num_pages() : int|string
Return values
int|string

get_posts()

public get_posts() : mixed
Return values
mixed

get_total_filtered_posts()

public get_total_filtered_posts() : mixed
Return values
mixed

get_total_posts()

public get_total_posts() : mixed
Return values
mixed

is_filtered_frontend()

Is the query filtered by the user on the frontend.

public is_filtered_frontend() : mixed
Return values
mixed

set_posts()

public set_posts(mixed $posts) : mixed
Parameters
$posts : mixed
Return values
mixed

set_total_filtered_posts()

public set_total_filtered_posts(mixed $total_filtered_posts) : mixed
Parameters
$total_filtered_posts : mixed
Return values
mixed

set_total_posts()

public set_total_posts(mixed $total_posts) : mixed
Parameters
$total_posts : mixed
Return values
mixed

add_query_hooks()

private add_query_hooks() : mixed
Return values
mixed

add_user_search_args()

private add_user_search_args(array<string|int, mixed> $query_args) : mixed
Parameters
$query_args : array<string|int, mixed>
Return values
mixed

array_map_prefix_column()

Array map callback to prefix column.

private static array_map_prefix_column(string $n) : string
Parameters
$n : string
Return values
string

build_base_posts_query()

private build_base_posts_query() : mixed
Return values
mixed

build_meta_query()

private build_meta_query() : mixed
Return values
mixed

build_post_totals_query()

private build_post_totals_query() : mixed
Return values
mixed

build_posts_query()

private build_posts_query() : mixed
Return values
mixed

build_search_filters_tax_query()

private build_search_filters_tax_query([mixed $tax_query = [] ]) : mixed
Parameters
$tax_query : mixed = []
Return values
mixed

build_tax_query()

private build_tax_query() : mixed
Return values
mixed

check_within_post_limit()

private check_within_post_limit(mixed $count) : mixed
Parameters
$count : mixed
Return values
mixed

get_order_by()

private get_order_by() : mixed
Return values
mixed

maybe_add_relation()

private maybe_add_relation(mixed $query[, mixed $relation = 'AND' ]) : mixed
Parameters
$query : mixed
$relation : mixed = 'AND'
Return values
mixed

maybe_nest_query()

private maybe_nest_query(mixed $main_query, mixed $inner_query) : mixed
Parameters
$main_query : mixed
$inner_query : mixed
Return values
mixed

remove_query_hooks()

private remove_query_hooks() : mixed
Return values
mixed

run_posts_query()

private run_posts_query(mixed $query_args) : mixed
Parameters
$query_args : mixed
Return values
mixed

tax_query_item()

Generate an inner array for the 'tax_query' arg in WP_Query.

private tax_query_item(string $terms, string $taxonomy[, string $operator = 'IN' ][, string $field = '' ]) : array<string|int, mixed>
Parameters
$terms : string

The list of terms as a string

$taxonomy : string

The taxonomy name

$operator : string = 'IN'

The SQL operator: IN, NOT IN, AND, etc

$field : string = ''

Add tax query by term_id or slug. Leave empty to auto-detect correct type

Return values
array<string|int, mixed>

A tax query sub-array

Search results