diff --git src/wp-includes/class-wp-editor.php src/wp-includes/class-wp-editor.php
index a61f239788..775042e86c 100644
|
|
final class _WP_Editors { |
1623 | 1623 | // Do main query. |
1624 | 1624 | $get_posts = new WP_Query; |
1625 | 1625 | $posts = $get_posts->query( $query ); |
1626 | | // Check if any posts were found. |
1627 | | if ( ! $get_posts->post_count ) |
1628 | | return false; |
1629 | 1626 | |
1630 | 1627 | // Build results. |
1631 | 1628 | $results = array(); |
| 1629 | |
| 1630 | // Check if any posts were found. |
| 1631 | if ( ! $get_posts->post_count ) { |
| 1632 | /** |
| 1633 | * Filters the link query results. |
| 1634 | * |
| 1635 | * Allows modification of the returned link query results. |
| 1636 | * |
| 1637 | * @since 3.7.0 |
| 1638 | * |
| 1639 | * @see 'wp_link_query_args' filter |
| 1640 | * |
| 1641 | * @param array $results { |
| 1642 | * An associative array of query results. |
| 1643 | * |
| 1644 | * @type array { |
| 1645 | * @type int $ID Post ID. |
| 1646 | * @type string $title The trimmed, escaped post title. |
| 1647 | * @type string $permalink Post permalink. |
| 1648 | * @type string $info A 'Y/m/d'-formatted date for 'post' post type, |
| 1649 | * the 'singular_name' post type label otherwise. |
| 1650 | * } |
| 1651 | * } |
| 1652 | * @param array $query An array of WP_Query arguments. |
| 1653 | */ |
| 1654 | $results = apply_filters( 'wp_link_query', $results, $query ); |
| 1655 | |
| 1656 | return ! empty( $results ) ? $results : false; |
| 1657 | } |
| 1658 | |
1632 | 1659 | foreach ( $posts as $post ) { |
1633 | 1660 | if ( 'post' == $post->post_type ) |
1634 | 1661 | $info = mysql2date( __( 'Y/m/d' ), $post->post_date ); |
… |
… |
final class _WP_Editors { |
1643 | 1670 | ); |
1644 | 1671 | } |
1645 | 1672 | |
1646 | | /** |
1647 | | * Filters the link query results. |
1648 | | * |
1649 | | * Allows modification of the returned link query results. |
1650 | | * |
1651 | | * @since 3.7.0 |
1652 | | * |
1653 | | * @see 'wp_link_query_args' filter |
1654 | | * |
1655 | | * @param array $results { |
1656 | | * An associative array of query results. |
1657 | | * |
1658 | | * @type array { |
1659 | | * @type int $ID Post ID. |
1660 | | * @type string $title The trimmed, escaped post title. |
1661 | | * @type string $permalink Post permalink. |
1662 | | * @type string $info A 'Y/m/d'-formatted date for 'post' post type, |
1663 | | * the 'singular_name' post type label otherwise. |
1664 | | * } |
1665 | | * } |
1666 | | * @param array $query An array of WP_Query arguments. |
1667 | | */ |
| 1673 | /** This filter is documented in wp-includes/class-wp-editor.php */ |
1668 | 1674 | return apply_filters( 'wp_link_query', $results, $query ); |
1669 | 1675 | } |
1670 | 1676 | |