WordPress.org

Make WordPress Core

Ticket #17026: parent-dropdown_filters_3.2.patch

File parent-dropdown_filters_3.2.patch, 812 bytes (added by kevinB, 9 years ago)

query filter for parent_dropdown()

  • wp-admin/includes/template.php

     
    675675 */
    676676function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
    677677        global $wpdb, $post_ID;
    678         $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
     678        $items = $wpdb->get_results( apply_filters( 'parent_dropdown_query', $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent ), $parent, 'page' ) );
    679679
    680680        if ( $items ) {
    681681                foreach ( $items as $item ) {