wp_link_query хук-фильтрWP 3.7.0

Filters the link query results.

Allows modification of the returned link query results.

Использование

add_filter( 'wp_link_query', 'wp_kama_link_query_filter', 10, 2 );

/**
 * Function for `wp_link_query` filter-hook.
 * 
 * @param array $results An array of associative arrays of query results.
 * @param array $query   An array of WP_Query arguments.
 *
 * @return array
 */
function wp_kama_link_query_filter( $results, $query ){

	// filter...
	return $results;
}
$results(массив)

An array of associative arrays of query results.

  • ...$0(массив)

    • ID(int)
      Post ID.

    • title(строка)
      The trimmed, escaped post title.

    • permalink(строка)
      Post permalink.

    • info(строка)
      A 'Y/m/d'-formatted date for 'post' post type, the 'singular_name' post type label otherwise.
$query(массив)
An array of WP_Query arguments.

Список изменений

С версии 3.7.0 Введена.

Где вызывается хук

_WP_Editors::wp_link_query()
wp_link_query
wp-includes/class-wp-editor.php 1855
$results = apply_filters( 'wp_link_query', $results, $query );

Где используется хук в WordPress

Использование не найдено.