posts_join WordPress Filter Hook

The posts_join hook is one of the most useful hooks in WordPress. It allows you to join multiple posts together into a single post. This is especially useful for creating custom post types or for joining together posts from different parts of your site.

apply_filters_ref_array( 'posts_join', string $join, WP_Query $query ) #

Filters the JOIN clause of the query.


Parameters

$join

(string)The JOIN clause of the query.

$query

(WP_Query)The WP_Query instance (passed by reference).


Top ↑

More Information

When you use the wp_query object to run a query, not all tables are queried by default. For example, a query on the blog archive will only query the posts table. If you wanted to display posts that have specific meta value you will have to alter the wp_query object to include the required meta key.


Top ↑

Source

File: wp-includes/class-wp-query.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More