WordPress.org

Make WordPress Core

Ticket #17026: 17026.diff

File 17026.diff, 773 bytes (added by wonderboymusic, 5 years ago)
  • wp-admin/includes/template.php

    diff --git wp-admin/includes/template.php wp-admin/includes/template.php
    index f8fac13..56cb9c5 100644
    function page_template_dropdown( $default = '' ) { 
    671671 * @return unknown
    672672 */
    673673function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
    674         global $wpdb;
    675674        $post = get_post();
    676         $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) );
     675
     676        $items = get_posts( apply_filters( 'parent_dropdown_args', array(
     677                'post_parent' => $parent,
     678                'post_type' => 'page',
     679                'orderby' => 'menu_order'
     680        ) ) );
    677681
    678682        if ( $items ) {
    679683                foreach ( $items as $item ) {