From b2ce0b4f932cd5bce639c235708a1e9e65c75432 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 7 Sep 2013 12:21:12 +0000 Subject: [PATCH] Add 'wp_link_query_args' and 'wp_link_query' filters to allow for customizing the internal linking dialog. props CoenJacobs, goldenapples. fixes #18042. Built from https://develop.svn.wordpress.org/trunk@25293 git-svn-id: http://core.svn.wordpress.org/trunk@25257 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 9ab3feb5c6..42283f5ec6 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -798,6 +798,8 @@ final class _WP_Editors { $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0; + $query = apply_filters( 'wp_link_query_args', $query ); + // Do main query. $get_posts = new WP_Query; $posts = $get_posts->query( $query ); @@ -821,7 +823,7 @@ final class _WP_Editors { ); } - return $results; + return apply_filters( 'wp_link_query', $results, $query ); } /**