- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r33593 r34111 165 165 * 166 166 * @since 3.0.0 167 * @since 4.4.0 Introduced the `$echo` argument. 167 168 * 168 169 * @param int $post_id Optional. Post ID. Default 0. … … 180 181 * @type bool $checked_ontop Whether to move checked items out of the hierarchy and to 181 182 * the top of the list. Default true. 183 * @type bool $echo Whether to echo the generated markup. False to return the markup instead 184 * of echoing it. Default true. 182 185 * } 183 186 */ … … 189 192 'walker' => null, 190 193 'taxonomy' => 'category', 191 'checked_ontop' => true 194 'checked_ontop' => true, 195 'echo' => true, 192 196 ); 193 197 … … 252 256 } 253 257 258 $output = ''; 259 254 260 if ( $r['checked_ontop'] ) { 255 261 // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) … … 257 263 $keys = array_keys( $categories ); 258 264 259 foreach ( $keys as $k ) {265 foreach ( $keys as $k ) { 260 266 if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { 261 267 $checked_categories[] = $categories[$k]; … … 265 271 266 272 // Put checked cats on top 267 echocall_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) );273 $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) ); 268 274 } 269 275 // Then the rest of them 270 echo call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) ); 276 $output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) ); 277 278 if ( $r['echo'] ) { 279 echo $output; 280 } 281 282 return $output; 271 283 } 272 284 … … 479 491 <form method="get"> 480 492 <?php if ( $table_row ) : ?> 481 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">493 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange"> 482 494 <?php else : ?> 483 495 <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;"> … … 487 499 <div id="edithead" style="display:none;"> 488 500 <div class="inside"> 489 <label for="author "><?php _e('Name') ?></label>490 <input type="text" name="newcomment_author" size="50" value="" id="author " />501 <label for="author-name"><?php _e( 'Name' ) ?></label> 502 <input type="text" name="newcomment_author" size="50" value="" id="author-name" /> 491 503 </div> 492 504 493 505 <div class="inside"> 494 <label for="author-email"><?php _e('E -mail') ?></label>506 <label for="author-email"><?php _e('Email') ?></label> 495 507 <input type="text" name="newcomment_author_email" size="50" value="" id="author-email" /> 496 508 </div> … … 743 755 * 744 756 * @since 0.71 745 * 746 * @global WP_Locale $wp_locale747 * @global object $comment757 * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`. 758 * 759 * @global WP_Locale $wp_locale 748 760 * 749 761 * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. … … 754 766 */ 755 767 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 756 global $wp_locale , $comment;768 global $wp_locale; 757 769 $post = get_post(); 758 770 … … 768 780 769 781 $time_adj = current_time('timestamp'); 770 $post_date = ($for_post) ? $post->post_date : $comment->comment_date;782 $post_date = ($for_post) ? $post->post_date : get_comment()->comment_date; 771 783 $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj ); 772 784 $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj ); … … 849 861 * 850 862 * @since 1.5.0 863 * @since 4.4.0 `$post` argument was added. 851 864 * 852 865 * @global wpdb $wpdb 853 866 * 854 * @param int $default Optional. The default page ID to be pre-selected. Default 0. 855 * @param int $parent Optional. The parent page ID. Default 0. 856 * @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. 857 871 * 858 872 * @return null|false Boolean False if page has no children, otherwise print out html elements 859 873 */ 860 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {874 function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) { 861 875 global $wpdb; 862 $post = get_post( );876 $post = get_post( $post ); 863 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) ); 864 878 … … 1084 1098 $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; 1085 1099 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; 1086 if ( 'dashboard_browser_nag' != $box['id'] ) 1087 echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>'; 1100 if ( 'dashboard_browser_nag' != $box['id'] ) { 1101 echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">'; 1102 echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />'; 1103 echo '</button>'; 1104 } 1088 1105 echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n"; 1089 1106 echo '<div class="inside">' . "\n";
Note: See TracChangeset
for help on using the changeset viewer.