wp_link_query
Filters the link query results.
Description
Allows modification of the returned link query results.
Parameters (2)
- 0. $results (array)
- 1. $query (array)
- An array of
WP_Query
arguments.
Usage
- To run the hook, copy the example below.
- $results = apply_filters( 'wp_link_query', $results, $query );
- if ( !empty( $results ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_link_query callback
- function filter_wp_link_query( $results, $query ) {
- // make filter magic happen here...
- return $results;
- };
- // add the filter
- add_filter( 'wp_link_query', 'filter_wp_link_query', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_link_query', 'filter_wp_link_query', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/class-wp-editor.php
- return apply_filters( 'wp_link_query', $results, $query );