Recent

Top_Ten_Core_Query class

Top_Ten_Core_Query

Query API: Top_Ten_Core_Query class.

Namespace: WebberZone\Top_Ten
Since: 4.0.0
Source: includes/class-top-ten-core-query.php line 25 Extends: WP_Query

Methods

__construct()

Main constructor.

Since: 3.0.0
Line: 122

public function __construct( $args = ... );
TypeNameDescription
array|string$argsThe Query variables. Accepts an array or a query string.

hooks()

Set up hooks.

Since: 4.0.0
Line: 135

public function hooks(  );

prepare_query_args()

Prepare the query variables.

Since: 3.0.0
Line: 168

public function prepare_query_args( $args = ... );
TypeNameDescription
string|array$args{

pre_get_posts()

Modify the pre_get_posts clause.

Since: 4.0.0
Line: 464

public function pre_get_posts( $query );
TypeNameDescription
\WP_Query$queryThe WP_Query instance.

posts_fields()

Modify the SELECT clause - posts_fields.

Since: 3.0.0
Line: 501

public function posts_fields( $fields, $query ): string;
TypeNameDescription
string$fieldsThe SELECT clause of the query.
\WP_Query$queryThe \WP_Query instance.

Returns: string — Updated Fields

posts_join()

Modify the posts_join clause.

Since: 3.0.0
Line: 539

public function posts_join( $join, $query ): string;
TypeNameDescription
string$joinThe JOIN clause of the query.
\WP_Query$queryThe \WP_Query instance.

Returns: string — Updated JOIN

posts_where()

Modify the posts_where clause.

Since: 3.0.0
Line: 573

public function posts_where( $where, $query ): string;
TypeNameDescription
string$whereThe WHERE clause of the query.
\WP_Query$queryThe \WP_Query instance.

Returns: string — Updated WHERE

posts_orderby()

Modify the ORDER BY clause of the query.

Since: 3.0.0
Line: 623

public function posts_orderby( $orderby, $query ): string;
TypeNameDescription
string$orderbyThe current ORDER BY clause.
\WP_Query$queryThe current query instance.

Returns: string — Modified ORDER BY clause.

posts_groupby()

Modify the posts_groupby clause.

Since: 3.0.0
Line: 665

public function posts_groupby( $groupby, $query ): string;
TypeNameDescription
string$groupbyThe GROUP BY clause of the query.
\WP_Query$queryThe \WP_Query instance.

Returns: string — Updated GROUP BY

posts_clauses()

Modify posts_clauses in WP_Query to handle multiple blogs.

Since: 3.2.0
Line: 700

public function posts_clauses( $clauses, $query ): array;
TypeNameDescription
array$clausesQuery clauses.
\WP_Query$queryThe \WP_Query instance.

Returns: array — Updated Query Clauses.

posts_request()

Modify the completed SQL query before sending.

Since: 3.2.0
Line: 765

public function posts_request( $sql, $query ): string;
TypeNameDescription
string$sqlThe complete SQL query.
\WP_Query$queryThe \WP_Query instance (passed by reference).

Returns: string — Updated SQL.

switch_to_blog_in_loop()

Update the_post while \WP_Query loops through this.

Since: 3.2.0
Line: 805

public function switch_to_blog_in_loop( $post );
TypeNameDescription
\WP_Post$postThe Post object (passed by reference).

loop_end()

Restore current blog on loop end.

Since: 3.2.0
Line: 821

public function loop_end(  );

posts_pre_query()

Filter posts_pre_query to allow caching to work.

Since: 3.0.0
Line: 836

public function posts_pre_query( $posts, $query ): \WP_Post[];
TypeNameDescription
\WP_Post[]$postsArray of post objects.
\WP_Query$queryThe WP_Query instance (passed by reference).

Returns: \WP_Post[] — Updated Array of post objects.

the_posts()

Modify the array of retrieved posts.

Since: 3.0.0
Line: 891

public function the_posts( $posts, $query ): \WP_Post[];
TypeNameDescription
\WP_Post[]$postsArray of post objects.
\WP_Query$queryThe \WP_Query instance (passed by reference).

Returns: \WP_Post[] — Updated Array of post objects.