WordPress.org

Make WordPress Core

Ticket #18042: 18042.diff

File 18042.diff, 618 bytes (added by goldenapples, 19 months ago)

Since #21861 was closed, I've moved @CoenJacobs's patch from that ticket here. Also added a filter on the return value so plugins can rearrange the order that custom post types appear in the returned array.

  • wp-includes/class-wp-editor.php

     
    731731 
    732732                $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0; 
    733733 
     734                $query = apply_filters( 'wp_link_query_args', $query ); 
     735 
    734736                // Do main query. 
    735737                $get_posts = new WP_Query; 
    736738                $posts = $get_posts->query( $query ); 
     
    754756                        ); 
    755757                } 
    756758 
    757                 return $results; 
     759                return apply_filters( 'wp_link_query_results', $results ); 
    758760        } 
    759761 
    760762        /**