Ticket #49223: 49223.patch
File 49223.patch, 14.0 KB (added by , 5 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
462 462 if ( ! $post_format ) { 463 463 $post_format = '0'; 464 464 } 465 // Add in the current one if it isn't there yet, in case the current theme doesn't support it 465 // Add in the current one if it isn't there yet, in case the current theme doesn't support it. 466 466 if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) { 467 467 $post_formats[0][] = $post_format; 468 468 } … … 941 941 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> 942 942 <?php echo $pages; ?> 943 943 <?php 944 endif; // end empty pages check945 endif; // end hierarchical check.944 endif; // End empty pages check. 945 endif; // End hierarchical check. 946 946 947 947 if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) : 948 948 $template = ! empty( $post->page_template ) ? $post->page_template : false; … … 1413 1413 1414 1414 // We should aim to show the revisions meta box only when there are revisions. 1415 1415 if ( count( $revisions ) > 1 ) { 1416 reset( $revisions ); // Reset pointer for key() 1416 reset( $revisions ); // Reset pointer for key(). 1417 1417 $publish_callback_args = array( 1418 1418 'revisions_count' => count( $revisions ), 1419 1419 'revision_id' => key( $revisions ), … … 1440 1440 add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); 1441 1441 } 1442 1442 1443 // all taxonomies1443 // All taxonomies. 1444 1444 foreach ( get_object_taxonomies( $post ) as $tax_name ) { 1445 1445 $taxonomy = get_taxonomy( $tax_name ); 1446 1446 if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) { -
wp-admin/includes/misc.php
178 178 $lines[] = rtrim( fgets( $fp ), "\r\n" ); 179 179 } 180 180 181 // Split out the existing file into the preceding lines, and those that appear after the marker 181 // Split out the existing file into the preceding lines, and those that appear after the marker. 182 182 $pre_lines = array(); 183 183 $post_lines = array(); 184 184 $existing_lines = array(); … … 201 201 } 202 202 } 203 203 204 // Check to see if there was a change 204 // Check to see if there was a change. 205 205 if ( $existing_lines === $insertion ) { 206 206 flock( $fp, LOCK_UN ); 207 207 fclose( $fp ); … … 209 209 return true; 210 210 } 211 211 212 // Generate the new file data 212 // Generate the new file data. 213 213 $new_file_data = implode( 214 214 "\n", 215 215 array_merge( … … 221 221 ) 222 222 ); 223 223 224 // Write to the start of the file, and truncate it to that length 224 // Write to the start of the file, and truncate it to that length. 225 225 fseek( $fp, 0 ); 226 226 $bytes = fwrite( $fp, $new_file_data ); 227 227 if ( $bytes ) { … … 296 296 $home_path = get_home_path(); 297 297 $web_config_file = $home_path . 'web.config'; 298 298 299 // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP 299 // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP. 300 300 if ( iis7_supports_permalinks() && ( ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable( $web_config_file ) ) ) { 301 301 $rule = $wp_rewrite->iis7_url_rewrite_rules( false ); 302 302 if ( ! empty( $rule ) ) { … … 598 598 } 599 599 600 600 if ( T_STRING == $tokens[ $t ][0] && ( '(' == $tokens[ $t + 1 ] || '(' == $tokens[ $t + 2 ] ) ) { 601 // If it's a function or class defined locally, there's not going to be any docs available 601 // If it's a function or class defined locally, there's not going to be any docs available. 602 602 if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ) ) ) || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] ) ) { 603 603 $ignore_functions[] = $tokens[ $t ][1]; 604 604 } 605 // Add this to our stack of unique references 605 // Add this to our stack of unique references. 606 606 $functions[] = $tokens[ $t ][1]; 607 607 } 608 608 } … … 673 673 case 'plugins_per_page': 674 674 case 'export_personal_data_requests_per_page': 675 675 case 'remove_personal_data_requests_per_page': 676 // Network admin 676 // Network admin. 677 677 case 'sites_network_per_page': 678 678 case 'users_network_per_page': 679 679 case 'site_users_network_per_page': … … 817 817 818 818 $xpath = new DOMXPath( $doc ); 819 819 820 // First check if the rule already exists as in that case there is no need to re-add it 820 // First check if the rule already exists as in that case there is no need to re-add it. 821 821 $wordpress_rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' ); 822 822 if ( $wordpress_rules->length > 0 ) { 823 823 return true; 824 824 } 825 825 826 // Check the XPath to the rewrite rule and create XML nodes if they do not exist 826 // Check the XPath to the rewrite rule and create XML nodes if they do not exist. 827 827 $xmlnodes = $xpath->query( '/configuration/system.webServer/rewrite/rules' ); 828 828 if ( $xmlnodes->length > 0 ) { 829 829 $rules_node = $xmlnodes->item( 0 ); -
wp-admin/includes/ms-admin-filters.php
10 10 // Media Hooks. 11 11 add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' ); 12 12 13 // User Hooks 13 // User Hooks. 14 14 add_action( 'user_admin_notices', 'new_user_email_admin_notice' ); 15 15 add_action( 'network_admin_notices', 'new_user_email_admin_notice' ); 16 16 … … 19 19 // Site Hooks. 20 20 add_action( 'wpmueditblogaction', 'upload_space_setting' ); 21 21 22 // Network hooks 22 // Network hooks. 23 23 add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 ); 24 24 25 // Taxonomy Hooks 25 // Taxonomy Hooks. 26 26 add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 ); 27 27 28 28 // Post Hooks. … … 31 31 // Tools Hooks. 32 32 add_filter( 'import_allow_create_users', 'check_import_new_users' ); 33 33 34 // Notices Hooks 34 // Notices Hooks. 35 35 add_action( 'admin_notices', 'site_admin_notice' ); 36 36 add_action( 'network_admin_notices', 'site_admin_notice' ); 37 37 38 // Update Hooks 38 // Update Hooks. 39 39 add_action( 'network_admin_notices', 'update_nag', 3 ); 40 40 add_action( 'network_admin_notices', 'maintenance_nag', 10 ); 41 41 42 // Network Admin Hooks 42 // Network Admin Hooks. 43 43 add_action( 'add_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 ); 44 44 add_action( 'update_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 ); -
wp-admin/includes/ms.php
20 20 return $file; 21 21 } 22 22 23 if ( $file['error'] != '0' ) { // there's already an error23 if ( $file['error'] != '0' ) { // There's already an error. 24 24 return $file; 25 25 } 26 26 … … 220 220 221 221 $space_allowed = get_space_allowed(); 222 222 if ( ! is_numeric( $space_allowed ) ) { 223 $space_allowed = 10; // Default space allowed is 10 MB 223 $space_allowed = 10; // Default space allowed is 10 MB. 224 224 } 225 225 $space_used = get_space_used(); 226 226 … … 644 644 foreach ( (array) $lang_files as $val ) { 645 645 $code_lang = basename( $val, '.mo' ); 646 646 647 if ( $code_lang == 'en_US' ) { // American English 647 if ( $code_lang == 'en_US' ) { // American English. 648 648 $flag = true; 649 649 $ae = __( 'American English' ); 650 650 $output[ $ae ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>'; 651 } elseif ( $code_lang == 'en_GB' ) { // British English 651 } elseif ( $code_lang == 'en_GB' ) { // British English. 652 652 $flag = true; 653 653 $be = __( 'British English' ); 654 654 $output[ $be ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>'; … … 658 658 } 659 659 } 660 660 661 if ( $flag === false ) { // WordPress english661 if ( $flag === false ) { // WordPress English. 662 662 $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>'; 663 663 } 664 664 665 // Order by name 665 // Order by name. 666 666 uksort( $output, 'strnatcasecmp' ); 667 667 668 668 /** … … 1067 1067 ) 1068 1068 ); 1069 1069 1070 // Parse arguments 1070 // Parse arguments. 1071 1071 $parsed_args = wp_parse_args( 1072 1072 $args, 1073 1073 array( … … 1077 1077 ) 1078 1078 ); 1079 1079 1080 // Setup the links array 1080 // Setup the links array. 1081 1081 $screen_links = array(); 1082 1082 1083 // Loop through tabs 1083 // Loop through tabs. 1084 1084 foreach ( $parsed_args['links'] as $link_id => $link ) { 1085 1085 1086 // Skip link if user can't access 1086 // Skip link if user can't access. 1087 1087 if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) { 1088 1088 continue; 1089 1089 } 1090 1090 1091 // Link classes 1091 // Link classes. 1092 1092 $classes = array( 'nav-tab' ); 1093 1093 1094 1094 // Aria-current attribute. 1095 1095 $aria_current = ''; 1096 1096 1097 // Selected is set by the parent OR assumed by the $pagenow global 1097 // Selected is set by the parent OR assumed by the $pagenow global. 1098 1098 if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) { 1099 1099 $classes[] = 'nav-tab-active'; 1100 1100 $aria_current = ' aria-current="page"'; 1101 1101 } 1102 1102 1103 // Escape each class 1103 // Escape each class. 1104 1104 $esc_classes = implode( ' ', $classes ); 1105 1105 1106 // Get the URL for this link 1106 // Get the URL for this link. 1107 1107 $url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) ); 1108 1108 1109 // Add link to nav links 1109 // Add link to nav links. 1110 1110 $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>'; 1111 1111 } 1112 1112 -
wp-admin/includes/nav-menu.php
143 143 add_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); 144 144 wp_nav_menu_taxonomy_meta_boxes(); 145 145 146 // Register advanced menu items (columns) 146 // Register advanced menu items (columns). 147 147 add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); 148 148 149 149 // If first time editing, disable advanced items by default. … … 422 422 } 423 423 } 424 424 425 // @todo transient caching of these results with proper invalidation on updating of a post of this type 425 // @todo transient caching of these results with proper invalidation on updating of a post of this type. 426 426 $get_posts = new WP_Query; 427 427 $posts = $get_posts->query( $args ); 428 428 … … 1142 1142 ); 1143 1143 $messages = array(); 1144 1144 $menu_items = array(); 1145 // Index menu items by db ID 1145 // Index menu items by db ID. 1146 1146 foreach ( $unsorted_menu_items as $_item ) { 1147 1147 $menu_items[ $_item->db_id ] = $_item; 1148 1148 } … … 1164 1164 ); 1165 1165 1166 1166 wp_defer_term_counting( true ); 1167 // Loop through all the menu items' POST variables 1167 // Loop through all the menu items' POST variables. 1168 1168 if ( ! empty( $_POST['menu-item-db-id'] ) ) { 1169 1169 foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) { 1170 1170 1171 // Menu item title can't be blank 1171 // Menu item title can't be blank. 1172 1172 if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' == $_POST['menu-item-title'][ $_key ] ) { 1173 1173 continue; 1174 1174 } … … 1188 1188 } 1189 1189 } 1190 1190 1191 // Remove menu items from the menu that weren't in $_POST 1191 // Remove menu items from the menu that weren't in $_POST. 1192 1192 if ( ! empty( $menu_items ) ) { 1193 1193 foreach ( array_keys( $menu_items ) as $menu_item_id ) { 1194 1194 if ( is_nav_menu_item( $menu_item_id ) ) { … … 1213 1213 unset( $nav_menu_option['auto_add'][ $key ] ); 1214 1214 } 1215 1215 } 1216 // Remove nonexistent/deleted menus 1216 // Remove nonexistent/deleted menus. 1217 1217 $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) ); 1218 1218 update_option( 'nav_menu_options', $nav_menu_option ); 1219 1219 -
wp-admin/includes/network.php
181 181 182 182 if ( isset( $_POST['subdomain_install'] ) ) { 183 183 $subdomain_install = (bool) $_POST['subdomain_install']; 184 } elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // assume nothing184 } elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // Assume nothing. 185 185 $subdomain_install = true; 186 186 } elseif ( ! allow_subdirectory_install() ) { 187 187 $subdomain_install = true; … … 188 188 } else { 189 189 $subdomain_install = false; 190 190 $got_mod_rewrite = got_mod_rewrite(); 191 if ( $got_mod_rewrite ) { // dangerous assumptions191 if ( $got_mod_rewrite ) { // Dangerous assumptions. 192 192 echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> '; 193 193 printf( 194 194 /* translators: %s: mod_rewrite */ … … 206 206 echo '</p>'; 207 207 } 208 208 209 if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache) 209 if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache). 210 210 echo '<p>'; 211 211 printf( 212 212 /* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */ … … 547 547 </li> 548 548 <?php 549 549 if ( iis7_supports_permalinks() ) : 550 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us 550 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us. 551 551 $iis_subdir_match = ltrim( $base, '/' ) . $subdir_match; 552 552 $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base; 553 553 $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';