Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #41825


Ignore:
Timestamp:
09/08/2017 08:37:53 AM (7 years ago)
Author:
swissspidy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #41825

    • Property Version changed from trunk to 3.7
  • Ticket #41825 – Description

    initial v1  
    22https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-editor.php
    33
    4 We have the public static function wp_link_query, which allows tos earch for internal links. There's also the possibility to alter the query 'wp_link_query_args' and to filter the results with 'wp_link_query'
     4We have the public static function wp_link_query, which allows to search for internal links. There's also the possibility to alter the query 'wp_link_query_args' and to filter the results with 'wp_link_query'
    55
    6 Now the problem is, if a plugin *adds* additional search results in wp_link_query, that is possible, but if the WordPress Query itself finds nothign we return false. It would be nice to apply the filter there as well, as a plugin may be able to find more results, even if WP_Query finds nothing.
     6Now the problem is, if a plugin *adds* additional search results in wp_link_query, that is possible, but if the WordPress Query itself finds nothing we return false. It would be nice to apply the filter there as well, as a plugin may be able to find more results, even if WP_Query finds nothing.
    77
    88So I'd propose to change
    99
    10 >if ( ! $get_posts->post_count )
    11 > return false;
     10{{{
     11if ( ! $get_posts->post_count )
     12 return false;
     13}}}
    1214
    1315to
    1416
    15 >if ( ! $get_posts->post_count )
    16 > return apply_filters( 'wp_link_query', false, $query );
     17{{{
     18if ( ! $get_posts->post_count )
     19 return apply_filters( 'wp_link_query', false, $query );
     20}}}
    1721
    1822Behold, as I'm planning to discuss and maybe change this with @swissspidy at a contributor day tomorrow in bern switzerland.