Ticket #23162: 23162.diff
| File 23162.diff, 1.7 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/includes/template.php
767 767 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 768 768 global $wp_locale; 769 769 $post = get_post(); 770 770 771 771 if ( $for_post ) 772 772 $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ); 773 773 … … 860 860 * Print out option HTML elements for the page parents drop-down. 861 861 * 862 862 * @since 1.5.0 863 * @since 4.4.0 `$post` argument was added. 863 864 * 864 865 * @global wpdb $wpdb 865 866 * 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. 869 871 * 870 872 * @return null|false Boolean False if page has no children, otherwise print out html elements 871 873 */ 872 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {874 function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) { 873 875 global $wpdb; 874 $post = get_post( );876 $post = get_post( $post ); 875 877 $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) ); 876 878 877 879 if ( $items ) {