Changeset 47122 for trunk/src/wp-admin/includes/template.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r47102 r47122 16 16 17 17 // 18 // Category Checklists 18 // Category Checklists. 19 19 // 20 20 … … 166 166 167 167 if ( $parsed_args['checked_ontop'] ) { 168 // 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) 168 // Post-process $categories rather than adding an exclude to the get_terms() query 169 // to keep the query the same across all posts (for any query cache). 169 170 $checked_categories = array(); 170 171 $keys = array_keys( $categories ); … … 177 178 } 178 179 179 // Put checked cat s on top180 // Put checked categories on top. 180 181 $output .= $walker->walk( $checked_categories, 0, $args ); 181 182 } 182 // Then the rest of them 183 // Then the rest of them. 183 184 $output .= $walker->walk( $categories, 0, $args ); 184 185 … … 266 267 if ( $link_id ) { 267 268 $checked_categories = wp_get_link_cats( $link_id ); 268 // No selected categories, strange 269 // No selected categories, strange. 269 270 if ( ! count( $checked_categories ) ) { 270 271 $checked_categories[] = $default; … … 560 561 */ 561 562 function list_meta( $meta ) { 562 // Exit if no meta 563 // Exit if no meta. 563 564 if ( ! $meta ) { 564 565 echo ' … … 573 574 <tr><td></td></tr> 574 575 </tbody> 575 </table>'; // TBODY needed for list-manipulation JS576 </table>'; // TBODY needed for list-manipulation JS. 576 577 return; 577 578 } … … 633 634 634 635 $entry['meta_key'] = esc_attr( $entry['meta_key'] ); 635 $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a <textarea />636 $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // Using a <textarea />. 636 637 $entry['meta_id'] = (int) $entry['meta_id']; 637 638 … … 791 792 } 792 793 793 // todo:Remove this?794 // @todo Remove this? 794 795 // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />'; 795 796 … … 926 927 foreach ( $editable_roles as $role => $details ) { 927 928 $name = translate_user_role( $details['name'] ); 928 // preselect specified role929 // Preselect specified role. 929 930 if ( $selected == $role ) { 930 931 $r .= "\n\t<option selected='selected' value='" . esc_attr( $role ) . "'>$name</option>"; … … 1053 1054 // If a core box was previously added or removed by a plugin, don't add. 1054 1055 if ( 'core' == $priority ) { 1055 // If core box previously deleted, don't add 1056 // If core box previously deleted, don't add. 1056 1057 if ( false === $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) { 1057 1058 return; … … 1068 1069 return; 1069 1070 } 1070 // If no priority given and idalready present, use existing priority.1071 // If no priority given and ID already present, use existing priority. 1071 1072 if ( empty( $priority ) ) { 1072 1073 $priority = $a_priority; … … 1080 1081 $callback_args = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['args']; 1081 1082 } 1082 // An idcan be in only one priority and one context.1083 // An ID can be in only one priority and one context. 1083 1084 if ( $priority != $a_priority || $context != $a_context ) { 1084 1085 unset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ); … … 1246 1247 printf( '<div id="%s-sortables" class="meta-box-sortables">', esc_attr( $context ) ); 1247 1248 1248 // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose 1249 // Grab the ones the user has manually sorted. 1250 // Pull them out of their previous context/priority and into the one the user chose. 1249 1251 $sorted = get_user_option( "meta-box-order_$page" ); 1250 1252 if ( ! $already_sorted && $sorted ) { … … 2193 2195 $header_image = get_header_image(); 2194 2196 2195 // Display "Header Image" if the image was ever used as a header image 2197 // Display "Header Image" if the image was ever used as a header image. 2196 2198 if ( ! empty( $meta_header ) && $meta_header == $stylesheet && $header_image !== wp_get_attachment_url( $post->ID ) ) { 2197 2199 $media_states[] = __( 'Header Image' ); 2198 2200 } 2199 2201 2200 // Display "Current Header Image" if the image is currently the header image 2202 // Display "Current Header Image" if the image is currently the header image. 2201 2203 if ( $header_image && $header_image == wp_get_attachment_url( $post->ID ) ) { 2202 2204 $media_states[] = __( 'Current Header Image' ); … … 2379 2381 $text = $text ? $text : __( 'Save Changes' ); 2380 2382 2381 // Default the id attribute to $name unless an id was specifically provided in $other_attributes 2383 // Default the id attribute to $name unless an id was specifically provided in $other_attributes. 2382 2384 $id = $name; 2383 2385 if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) { … … 2389 2391 if ( is_array( $other_attributes ) ) { 2390 2392 foreach ( $other_attributes as $attribute => $value ) { 2391 $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important 2392 } 2393 } elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string 2393 $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important. 2394 } 2395 } elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string. 2394 2396 $attributes = $other_attributes; 2395 2397 } … … 2534 2536 $parsed_args = wp_parse_args( $args, $defaults ); 2535 2537 2536 // Non-English decimal places when the $rating is coming from a string 2538 // Non-English decimal places when the $rating is coming from a string. 2537 2539 $rating = (float) str_replace( ',', '.', $parsed_args['rating'] ); 2538 2540 2539 // Convert Percentage to star rating, 0..5 in .5 increments2541 // Convert percentage to star rating, 0..5 in .5 increments. 2540 2542 if ( 'percent' === $parsed_args['type'] ) { 2541 2543 $rating = round( $rating / 10, 0 ) / 2; 2542 2544 } 2543 2545 2544 // Calculate the number of each type of star needed 2546 // Calculate the number of each type of star needed. 2545 2547 $full_stars = floor( $rating ); 2546 2548 $half_stars = ceil( $rating - $full_stars );
Note: See TracChangeset
for help on using the changeset viewer.