WordPress.org

Make WordPress Core

Ticket #23162: 23162.diff

File 23162.diff, 1.7 KB (added by wonderboymusic, 6 years ago)
  • src/wp-admin/includes/template.php

     
    767767function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
    768768        global $wp_locale;
    769769        $post = get_post();
    770        
     770
    771771        if ( $for_post )
    772772                $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
    773773
     
    860860 * Print out option HTML elements for the page parents drop-down.
    861861 *
    862862 * @since 1.5.0
     863 * @since 4.4.0 `$post` argument was added.
    863864 *
    864865 * @global wpdb $wpdb
    865866 *
    866  * @param int $default Optional. The default page ID to be pre-selected. Default 0.
    867  * @param int $parent  Optional. The parent page ID. Default 0.
    868  * @param int $level   Optional. Page depth level. Default 0.
     867 * @param int         $default Optional. The default page ID to be pre-selected. Default 0.
     868 * @param int         $parent  Optional. The parent page ID. Default 0.
     869 * @param int         $level   Optional. Page depth level. Default 0.
     870 * @param int|WP_Post $post    Post ID or WP_Post object.
    869871 *
    870872 * @return null|false Boolean False if page has no children, otherwise print out html elements
    871873 */
    872 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
     874function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) {
    873875        global $wpdb;
    874         $post = get_post();
     876        $post = get_post( $post );
    875877        $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) );
    876878
    877879        if ( $items ) {