Filters the link query arguments.
Description
Allows modification of the link query arguments before querying.
See also
- WP_Query: for a full list of arguments
Parameters
$query
array- An array of WP_Query arguments.
Source
$query = apply_filters( 'wp_link_query_args', $query );
Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |
Example Migrated from Codex:
Any allowable WP_Query parameters can be passed to
wp_link_query_args
. One example is filtering out post types:Show only posts and pages
If you wanted only allow posts and pages to show up in the linked results, you could do something like this. In this example, we’re going to check to make sure we aren’t in the admin, so results would only be filtered on the front end, but admins could still add links to all post types.
Remove specific post types from results
You’d use something like this if you only wanted to remove specific post types from the results.