mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02:00
Document 'wp_link_query_args' and 'wp_link_query' filters. props DrewAPicture. fixes #18042.
Built from https://develop.svn.wordpress.org/trunk@25299 git-svn-id: http://core.svn.wordpress.org/trunk@25262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
05d55a400b
commit
6e5a5d21e0
@ -798,6 +798,17 @@ final class _WP_Editors {
|
|||||||
|
|
||||||
$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
|
$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the link query arguments.
|
||||||
|
*
|
||||||
|
* Allows modification of the link query arguments before querying.
|
||||||
|
*
|
||||||
|
* @see WP_Query for a full list of arguments
|
||||||
|
*
|
||||||
|
* @since 3.7.0
|
||||||
|
*
|
||||||
|
* @param array $query An array of WP_Query arguments.
|
||||||
|
*/
|
||||||
$query = apply_filters( 'wp_link_query_args', $query );
|
$query = apply_filters( 'wp_link_query_args', $query );
|
||||||
|
|
||||||
// Do main query.
|
// Do main query.
|
||||||
@ -823,6 +834,25 @@ final class _WP_Editors {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the link query results.
|
||||||
|
*
|
||||||
|
* Allows modification of the returned link query results.
|
||||||
|
*
|
||||||
|
* @since 3.7.0
|
||||||
|
*
|
||||||
|
* @param array $results {
|
||||||
|
* An associative array of query results.
|
||||||
|
*
|
||||||
|
* @type array {
|
||||||
|
* @type int 'ID' The post ID.
|
||||||
|
* @type string 'title' The trimmed, escaped post title.
|
||||||
|
* @type string 'permalink' The post permalink.
|
||||||
|
* @type string 'info' A 'Y/m/d'-formatted date for 'post' post type, the 'singular_name' post type label otherwise.
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* @param array $query An array of WP_Query arguments. @see 'wp_link_query_args' filter
|
||||||
|
*/
|
||||||
return apply_filters( 'wp_link_query', $results, $query );
|
return apply_filters( 'wp_link_query', $results, $query );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user