Filter hook 'wp_link_query'

in WP Core File wp-includes/class-wp-editor.php at line 1858

View Source

wp_link_query

Filter Hook
Description
Filters the link query results. Allows modification of the returned link query results. the 'singular_name' post type label otherwise. } }

Hook Information

File Location wp-includes/class-wp-editor.php View on GitHub
Hook Type Filter
Line Number 1858

Hook Parameters

Type Name Description
array $results { An array of associative arrays of query results.
array $query An array of WP_Query arguments.

Usage Examples

Basic Usage
<?php
// Hook into wp_link_query
add_filter('wp_link_query', 'my_custom_filter', 10, 2);

function my_custom_filter($results, $query) {
    // Your custom filtering logic here
    return $results;
}

Source Code Context

wp-includes/class-wp-editor.php:1858 - How this hook is used in WordPress core
<?php
1853  		 *                                 the 'singular_name' post type label otherwise.
1854  		 *     }
1855  		 * }
1856  		 * @param array $query  An array of WP_Query arguments.
1857  		 */
1858  		$results = apply_filters( 'wp_link_query', $results, $query );
1859  
1860  		return ! empty( $results ) ? $results : false;
1861  	}
1862  
1863  	/**

PHP Documentation

<?php
/**
		 * Filters the link query results.
		 *
		 * Allows modification of the returned link query results.
		 *
		 * @since 3.7.0
		 *
		 * @see 'wp_link_query_args' filter
		 *
		 * @param array $results {
		 *     An array of associative arrays of query results.
		 *
		 *     @type array ...$0 {
		 *         @type int    $ID        Post ID.
		 *         @type string $title     The trimmed, escaped post title.
		 *         @type string $permalink 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.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-editor.php
Related Hooks

Related hooks will be displayed here in future updates.