Ticket #50907: 50907.1.diff
File 50907.1.diff, 30.8 KB (added by , 3 years ago) |
---|
-
src/js/_enqueues/admin/common.js
diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js index 3832bcac2c..ef92097f66 100644
a b function deprecatedProperty( propName, version, replacement ) { 55 55 * Deprecate all properties on an object. 56 56 * 57 57 * @since 5.5.1 58 * @since 5.6.0 Added the `version` parameter.59 58 * 60 59 * @param {string} name The name of the object, i.e. commonL10n. 61 60 * @param {object} l10nObject The object to deprecate the properties on. 62 * @param {string} version The version of WordPress that deprecated the property.63 61 * 64 62 * @return {object} The object with all its properties deprecated. 65 63 */ 66 function deprecateL10nObject( name, l10nObject , version) {64 function deprecateL10nObject( name, l10nObject ) { 67 65 var deprecatedObject = {}; 68 66 69 67 Object.keys( l10nObject ).forEach( function( key ) { … … function deprecateL10nObject( name, l10nObject, version ) { 72 70 73 71 if ( 'object' === typeof prop ) { 74 72 Object.defineProperty( deprecatedObject, key, { get: function() { 75 deprecatedProperty( propName, version, prop.alternative );73 deprecatedProperty( propName, '5.5.0', prop.alternative ); 76 74 return prop.func(); 77 75 } } ); 78 76 } else { 79 77 Object.defineProperty( deprecatedObject, key, { get: function() { 80 deprecatedProperty( propName, version, 'wp.i18n' );78 deprecatedProperty( propName, '5.5.0', 'wp.i18n' ); 81 79 return prop; 82 80 } } ); 83 81 } … … window.commonL10n = window.commonL10n || { 101 99 expandMenu: '' 102 100 }; 103 101 104 window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n , '5.5.0');102 window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n ); 105 103 106 104 /** 107 105 * Removed in 5.5.0, needed for back-compatibility. … … window.wpPointerL10n = window.wpPointerL10n || { 113 111 dismiss: '' 114 112 }; 115 113 116 window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n , '5.5.0');114 window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n ); 117 115 118 116 /** 119 117 * Removed in 5.5.0, needed for back-compatibility. … … window.userProfileL10n = window.userProfileL10n || { 131 129 ariaHide: '' 132 130 }; 133 131 134 window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n , '5.5.0');132 window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n ); 135 133 136 134 /** 137 135 * Removed in 5.5.0, needed for back-compatibility. … … window.privacyToolsL10n = window.privacyToolsL10n || { 150 148 exportError: '' 151 149 }; 152 150 153 window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n , '5.5.0');151 window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n ); 154 152 155 153 /** 156 154 * Removed in 5.5.0, needed for back-compatibility. … … window.authcheckL10n = { 162 160 beforeunload: '' 163 161 }; 164 162 165 window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n , '5.5.0');163 window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n ); 166 164 167 165 /** 168 166 * Removed in 5.5.0, needed for back-compatibility. … … window.tagsl10n = { 175 173 broken: '' 176 174 }; 177 175 178 window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n , '5.5.0');176 window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n ); 179 177 180 178 /** 181 179 * Removed in 5.5.0, needed for back-compatibility. … … window.adminCommentsL10n = window.adminCommentsL10n || { 200 198 docTitleCommentsCount: '' 201 199 }; 202 200 203 window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n , '5.5.0');201 window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n ); 204 202 205 203 /** 206 204 * Removed in 5.5.0, needed for back-compatibility. … … window.tagsSuggestL10n = window.tagsSuggestL10n || { 216 214 termRemoved: '' 217 215 }; 218 216 219 window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n , '5.5.0');217 window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n ); 220 218 221 219 /** 222 220 * Removed in 5.5.0, needed for back-compatibility. … … window.wpColorPickerL10n = window.wpColorPickerL10n || { 233 231 defaultLabel: '' 234 232 }; 235 233 236 window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n , '5.5.0');234 window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n ); 237 235 238 236 /** 239 237 * Removed in 5.5.0, needed for back-compatibility. … … window.attachMediaBoxL10n = window.attachMediaBoxL10n || { 245 243 error: '' 246 244 }; 247 245 248 window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n , '5.5.0');246 window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n ); 249 247 250 248 /** 251 249 * Removed in 5.5.0, needed for back-compatibility. … … window.postL10n = window.postL10n || { 278 276 permalinkSaved: '' 279 277 }; 280 278 281 window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n , '5.5.0');279 window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n ); 282 280 283 281 /** 284 282 * Removed in 5.5.0, needed for back-compatibility. … … window.inlineEditL10n = window.inlineEditL10n || { 294 292 saved: '' 295 293 }; 296 294 297 window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n , '5.5.0');295 window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n ); 298 296 299 297 /** 300 298 * Removed in 5.5.0, needed for back-compatibility. … … window.plugininstallL10n = window.plugininstallL10n || { 308 306 ays: '' 309 307 }; 310 308 311 window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n , '5.5.0');309 window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n ); 312 310 313 311 /** 314 312 * Removed in 5.5.0, needed for back-compatibility. … … window.navMenuL10n = window.navMenuL10n || { 323 321 untitled: '' 324 322 }; 325 323 326 window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n , '5.5.0');324 window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n ); 327 325 328 326 /** 329 327 * Removed in 5.5.0, needed for back-compatibility. … … window.commentL10n = window.commentL10n || { 336 334 dateFormat: '' 337 335 }; 338 336 339 window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n , '5.5.0');337 window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n ); 340 338 341 339 /** 342 340 * Removed in 5.5.0, needed for back-compatibility. … … window.setPostThumbnailL10n = window.setPostThumbnailL10n || { 351 349 done: '' 352 350 }; 353 351 354 window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n , '5.5.0');352 window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n ); 355 353 356 354 /** 357 355 * Removed in 3.3.0, needed for back-compatibility. -
src/js/_enqueues/admin/widgets.js
diff --git a/src/js/_enqueues/admin/widgets.js b/src/js/_enqueues/admin/widgets.js index ed956157eb..fb3759bfc9 100644
a b wpWidgets.l10n = wpWidgets.l10n || { 760 760 widgetAdded: '' 761 761 }; 762 762 763 wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n , '5.5.0');763 wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n ); -
src/js/_enqueues/wp/dashboard.js
diff --git a/src/js/_enqueues/wp/dashboard.js b/src/js/_enqueues/wp/dashboard.js index 1929388d55..87a8493128 100644
a b 5 5 /* global pagenow, ajaxurl, postboxes, wpActiveEditor:true, ajaxWidgets */ 6 6 /* global ajaxPopulateWidgets, quickPressLoad, */ 7 7 window.wp = window.wp || {}; 8 window.communityEventsData = window.communityEventsData || {};9 8 10 9 /** 11 10 * Initializes the dashboard widget functionality. … … jQuery(document).ready( function($) { 266 265 jQuery( function( $ ) { 267 266 'use strict'; 268 267 269 var communityEventsData = window.communityEventsData ,268 var communityEventsData = window.communityEventsData || {}, 270 269 dateI18n = wp.date.dateI18n, 271 270 format = wp.date.format, 272 271 sprintf = wp.i18n.sprintf, … … jQuery( function( $ ) { 467 466 renderEventsTemplate: function( templateParams, initiatedBy ) { 468 467 var template, 469 468 elementVisibility, 469 l10nPlaceholder = /%(?:\d\$)?s/g, // Match `%s`, `%1$s`, `%2$s`, etc. 470 470 $toggleButton = $( '.community-events-toggle-location' ), 471 471 $locationMessage = $( '#community-events-location-message' ), 472 472 $results = $( '.community-events-results' ); … … jQuery( function( $ ) { 505 505 * If the API determined the location by geolocating an IP, it will 506 506 * provide events, but not a specific location. 507 507 */ 508 $locationMessage.text( __( 'Attend an upcoming event near you.' ));508 $locationMessage.text( communityEventsData.l10n.attend_event_near_generic ); 509 509 510 510 if ( templateParams.events.length ) { 511 511 template = wp.template( 'community-events-event-list' ); … … jQuery( function( $ ) { 532 532 } 533 533 534 534 if ( 'user' === initiatedBy ) { 535 wp.a11y.speak( 536 sprintf( 537 /* translators: %s: The name of a city. */ 538 __( 'City updated. Listing events near %s.' ), 539 templateParams.location.description 540 ), 541 'assertive' 542 ); 535 wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' ); 543 536 } 544 537 545 538 elementVisibility['#community-events-location-message'] = true; … … jQuery( function( $ ) { 549 542 } else if ( templateParams.unknownCity ) { 550 543 template = wp.template( 'community-events-could-not-locate' ); 551 544 $( '.community-events-could-not-locate' ).html( template( templateParams ) ); 552 wp.a11y.speak( 553 sprintf( 554 /* 555 * These specific examples were chosen to highlight the fact that a 556 * state is not needed, even for cities whose name is not unique. 557 * It would be too cumbersome to include that in the instructions 558 * to the user, so it's left as an implication. 559 */ 560 /* 561 * translators: %s is the name of the city we couldn't locate. 562 * Replace the examples with cities related to your locale. Test that 563 * they match the expected location and have upcoming events before 564 * including them. If no cities related to your locale have events, 565 * then use cities related to your locale that would be recognizable 566 * to most users. Use only the city name itself, without any region 567 * or country. Use the endonym (native locale name) instead of the 568 * English name if possible. 569 */ 570 __( 'We couldn’t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ), 571 templateParams.unknownCity 572 ) 573 ); 545 wp.a11y.speak( communityEventsData.l10n.could_not_locate_city.replace( l10nPlaceholder, templateParams.unknownCity ) ); 574 546 575 547 elementVisibility['.community-events-errors'] = true; 576 548 elementVisibility['.community-events-could-not-locate'] = true; … … jQuery( function( $ ) { 582 554 * Showing error messages for an event that user isn't aware of 583 555 * could be confusing or unnecessarily distracting. 584 556 */ 585 wp.a11y.speak( __( 'An error occurred. Please try again.' ));557 wp.a11y.speak( communityEventsData.l10n.error_occurred_please_try_again ); 586 558 587 559 elementVisibility['.community-events-errors'] = true; 588 560 elementVisibility['.community-events-error-occurred'] = true; 589 561 } else { 590 $locationMessage.text( __( 'Enter your closest city to find nearby events.' ));562 $locationMessage.text( communityEventsData.l10n.enter_closest_city ); 591 563 592 564 elementVisibility['#community-events-location-message'] = true; 593 565 elementVisibility['.community-events-toggle-location'] = true; … … jQuery( function( $ ) { 623 595 * These can't be stored in the database, because they're dependent on 624 596 * the user's current time zone, locale, etc. 625 597 * 626 * @since 5. 5.2598 * @since 5.6.0 627 599 * 628 600 * @param {Array} rawEvents The events that should have dynamic fields added to them. 629 601 * @param {string} timeFormat A time format acceptable by `wp.date.dateI18n()`. … … jQuery( function( $ ) { 658 630 /** 659 631 * Returns the user's local/browser time zone, in a form suitable for `wp.date.i18n()`. 660 632 * 661 * @since 5. 5.2633 * @since 5.6.0 662 634 * 663 635 * @param startTimestamp 664 636 * … … jQuery( function( $ ) { 693 665 * 694 666 * See https://stackoverflow.com/questions/21102435/why-does-javascript-date-gettimezoneoffset-consider-0500-as-a-positive-off. 695 667 * 696 * @since 5. 5.2668 * @since 5.6.0 697 669 * 698 670 * @param {number} startTimestamp 699 671 * … … jQuery( function( $ ) { 706 678 /** 707 679 * Get a short time zone name, like `PST`. 708 680 * 709 * @since 5. 5.2681 * @since 5.6.0 710 682 * 711 683 * @param {number} startTimestamp 712 684 * … … jQuery( function( $ ) { 748 720 /** 749 721 * Format a start/end date in the user's local time zone and locale. 750 722 * 751 * @since 5. 5.2723 * @since 5.6.0 752 724 * 753 725 * @param {int} startDate The Unix timestamp in milliseconds when the the event starts. 754 726 * @param {int} endDate The Unix timestamp in milliseconds when the the event ends. … … jQuery( function( $ ) { 819 791 }); 820 792 } 821 793 }); 822 823 /**824 * Removed in 5.6.0, needed for back-compatibility.825 *826 * @since 4.8.0827 * @deprecated 5.6.0828 *829 * @type {object}830 */831 window.communityEventsData.l10n = window.communityEventsData.l10n || {832 enter_closest_city: '',833 error_occurred_please_try_again: '',834 attend_event_near_generic: '',835 could_not_locate_city: '',836 city_updated: ''837 };838 839 window.communityEventsData.l10n = window.wp.deprecateL10nObject( 'communityEventsData.l10n', window.communityEventsData.l10n, '5.6.0' ); -
src/js/_enqueues/wp/theme-plugin-editor.js
diff --git a/src/js/_enqueues/wp/theme-plugin-editor.js b/src/js/_enqueues/wp/theme-plugin-editor.js index cffbc69637..59e8ce3d0c 100644
a b wp.themePluginEditor.l10n = wp.themePluginEditor.l10n || { 1023 1023 } 1024 1024 }; 1025 1025 1026 wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n , '5.5.0');1026 wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n ); -
src/js/_enqueues/wp/updates.js
diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js index 402afaf585..36a9437db9 100644
a b 115 115 autoUpdatesError: '' 116 116 }; 117 117 118 wp.updates.l10n = window.wp.deprecateL10nObject( 'wp.updates.l10n', wp.updates.l10n , '5.5.0');118 wp.updates.l10n = window.wp.deprecateL10nObject( 'wp.updates.l10n', wp.updates.l10n ); 119 119 120 120 /** 121 121 * User nonce for ajax calls. -
src/wp-admin/css/common.css
diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 083159a22f..e60ee25c6c 100644
a b h3 { 344 344 } 345 345 346 346 .update-core-php h2 { 347 margin-top: 2em;347 margin-top: 4em; 348 348 } 349 349 350 350 .update-php h2, -
src/wp-admin/includes/class-core-upgrader.php
diff --git a/src/wp-admin/includes/class-core-upgrader.php b/src/wp-admin/includes/class-core-upgrader.php index 4184bc8ea9..df0bbf141f 100644
a b class Core_Upgrader extends WP_Upgrader { 48 48 * 49 49 * @param object $current Response object for whether WordPress is current. 50 50 * @param array $args { 51 * Optional. Arguments for upgrading WordPress core. Default empty array.51 * Optional. Arguments for upgrading WordPress core. Default empty array. 52 52 * 53 * @type bool $pre_check_md5 Whether to check the file checksums before54 * attempting the upgrade. Default true.55 * @type bool $attempt_rollback Whether to attempt to rollback the chances if56 * there is a problem. Default false.57 * @type bool $do_rollback Whether to perform this "upgrade" as a rollback.58 * Default false.53 * @type bool $pre_check_md5 Whether to check the file checksums before 54 * attempting the upgrade. Default true. 55 * @type bool $attempt_rollback Whether to attempt to rollback the chances if 56 * there is a problem. Default false. 57 * @type bool $do_rollback Whether to perform this "upgrade" as a rollback. 58 * Default false. 59 59 * } 60 60 * @return string|false|WP_Error New WordPress version on success, false or WP_Error on failure. 61 61 */ … … class Core_Upgrader extends WP_Upgrader { 279 279 $current_is_development_version = (bool) strpos( $wp_version, '-' ); 280 280 281 281 // Defaults: 282 $upgrade_dev = true;283 $upgrade_minor = true;284 $upgrade_major = false;282 $upgrade_dev = get_site_option( 'auto_update_core_dev', true ); 283 $upgrade_minor = get_site_option( 'auto_update_core_minor', true ); 284 $upgrade_major = get_site_option( 'auto_update_core_major', false ); 285 285 286 286 // WP_AUTO_UPDATE_CORE = true (all), 'minor', false. 287 287 if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { -
src/wp-admin/includes/class-wp-community-events.php
diff --git a/src/wp-admin/includes/class-wp-community-events.php b/src/wp-admin/includes/class-wp-community-events.php index 35708547af..6f4a101067 100644
a b class WP_Community_Events { 77 77 * mitigates possible privacy concerns. 78 78 * 79 79 * @since 4.8.0 80 * @since 5. 5.2Response no longer contains formatted date field. They're added80 * @since 5.6.0 Response no longer contains formatted date field. They're added 81 81 * in `wp.communityEvents.populateDynamicEventFields()` now. 82 82 * 83 83 * @param string $location_search Optional. City name to help determine the location. … … class WP_Community_Events { 345 345 * Gets cached events. 346 346 * 347 347 * @since 4.8.0 348 * @since 5. 5.2Response no longer contains formatted date field. They're added348 * @since 5.6.0 Response no longer contains formatted date field. They're added 349 349 * in `wp.communityEvents.populateDynamicEventFields()` now. 350 350 * 351 351 * @return array|false An array containing `location` and `events` items … … class WP_Community_Events { 377 377 protected function format_event_data_time( $response_body ) { 378 378 _deprecated_function( 379 379 __METHOD__, 380 '5. 5.2',380 '5.6.0', 381 381 'This is no longer used by Core, and only kept for backwards-compatibility.' 382 382 ); 383 383 … … class WP_Community_Events { 451 451 * 452 452 * @since 4.8.0 453 453 * @since 4.9.7 Stick a WordCamp to the final list. 454 * @since 5. 5.2Accepts and returns only the events, rather than an entire HTTP response.454 * @since 5.6.0 Accepts and returns only the events, rather than an entire HTTP response. 455 455 * 456 456 * @param array $events The events that will be prepared. 457 457 * @return array The response body with events trimmed. -
src/wp-admin/update-core.php
diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index fcae12eaa0..a4ef446f10 100644
a b function core_upgrade_preamble() { 300 300 dismissed_updates(); 301 301 } 302 302 303 /** 304 * Display WordPress auto-updates settings. 305 * 306 * @since 5.6.0 307 */ 308 function core_auto_updates_settings() { 309 $upgrade_major_value = ''; 310 if ( isset( $_POST['core-auto-updates-settings'] ) && wp_verify_nonce( $_POST['set_core_auto_updates_settings'], 'core-auto-updates-nonce' ) ) { 311 if ( isset( $_POST['core-auto-updates-major'] ) && 1 === (int) $_POST['core-auto-updates-major'] ) { 312 update_site_option( 'auto_update_core_major', 1 ); 313 } else { 314 update_site_option( 'auto_update_core_major', 0 ); 315 } 316 echo '<div class="notice notice-info is-dismissible"><p>'; 317 _e( 'WordPress auto-updates settings updated.' ); 318 echo '</p></div>'; 319 } 320 321 $upgrade_dev = get_site_option( 'auto_update_core_dev', true ); 322 $upgrade_minor = get_site_option( 'auto_update_core_minor', true ); 323 $upgrade_major = get_site_option( 'auto_update_core_major', false ); 324 325 if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { 326 if ( false === WP_AUTO_UPDATE_CORE ) { 327 // Defaults to turned off, unless a filter allows it. 328 $upgrade_dev = false; 329 $upgrade_minor = false; 330 $upgrade_major = false; 331 } elseif ( true === WP_AUTO_UPDATE_CORE ) { 332 // ALL updates for core. 333 $upgrade_dev = true; 334 $upgrade_minor = true; 335 $upgrade_major = true; 336 } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) { 337 // Only minor updates for core. 338 $upgrade_dev = false; 339 $upgrade_minor = true; 340 $upgrade_major = false; 341 } 342 } 343 344 $upgrade_dev = apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ); 345 $upgrade_minor = apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor ); 346 $upgrade_major = apply_filters( 'allow_major_auto_core_updates', $upgrade_major ); 347 348 $auto_update_settings = array( 349 'dev' => $upgrade_dev, 350 'minor' => $upgrade_minor, 351 'major' => $upgrade_major, 352 ); 353 ?> 354 <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" name="core-auto-updates" class="form-core-auto-updates"> 355 <?php wp_nonce_field( 'core-auto-updates-nonce', 'set_core_auto_updates_settings' ); ?> 356 <h2><?php _e( 'WordPress auto-updates settings' ); ?></h2> 357 <p> 358 <?php 359 if ( $auto_update_settings['major'] ) { 360 $wp_version = get_bloginfo( 'version' ); 361 $updates = get_core_updates(); 362 if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { 363 echo wp_get_auto_update_message(); 364 } 365 } 366 ?> 367 </p> 368 <p> 369 <input type="checkbox" name="core-auto-updates-major" id="core-auto-updates-major" value="1" <?php checked( $auto_update_settings['major'], 1 ); ?> /> 370 <label for="core-auto-updates-major"> 371 <?php _e( 'Keep my site up-to-date with regular feature updates (major versions).' ); ?> 372 </label> 373 </p> 374 <?php 375 /** 376 * Fires after the major core auto-update checkbox. 377 * 378 * @since 5.6.0 379 */ 380 do_action( 'after_core_auto_updates_settings_fields', $auto_update_settings ); 381 ?> 382 <p> 383 <input id="core-auto-updates-settings" class="button" type="submit" value="<?php esc_attr_e( 'Save settings' ); ?>" name="core-auto-updates-settings" /> 384 </p> 385 <?php 386 } 387 303 388 /** 304 389 * Display the upgrade plugins form. 305 390 * … … if ( 'upgrade-core' === $action ) { 890 975 891 976 if ( current_user_can( 'update_core' ) ) { 892 977 core_upgrade_preamble(); 978 core_auto_updates_settings(); 893 979 } 894 980 if ( current_user_can( 'update_plugins' ) ) { 895 981 list_plugin_updates(); -
src/wp-includes/default-filters.php
diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index dbc4fefb09..cd6b86f816 100644
a b add_action( 'wp_head', 'wp_print_styles', 8 ); 297 297 add_action( 'wp_head', 'wp_print_head_scripts', 9 ); 298 298 add_action( 'wp_head', 'wp_generator' ); 299 299 add_action( 'wp_head', 'rel_canonical' ); 300 add_action( 'wp_head', 'rel_feed_for_posts', 10, 0 ); 300 301 add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); 301 302 add_action( 'wp_head', 'wp_custom_css_cb', 101 ); 302 303 add_action( 'wp_head', 'wp_site_icon', 99 ); -
src/wp-includes/general-template.php
diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index dc5b374121..52bc061a28 100644
a b function wp_enqueue_code_editor( $args ) { 3643 3643 return $settings; 3644 3644 } 3645 3645 3646 /** 3647 * Adds a link rel=feed element to the home page when a static front page is set in Settings > Reading. 3648 * 3649 * See {@see 'wp_head'}. 3650 * 3651 * @since 5.6.0 3652 */ 3653 function rel_feed_for_posts() { 3654 $page_for_posts = get_option( 'page_for_posts' ); 3655 3656 if ( is_front_page() && ! is_home() ) { 3657 echo '<link rel="feed" type="text/html" href="' . get_the_permalink( $page_for_posts ) . '" title="' . the_title_attribute( array( 'echo' => false, 'post' => $page_for_posts ) ) . '" />'; 3658 } 3659 } 3660 3646 3661 /** 3647 3662 * Generate and return code editor settings. 3648 3663 * -
src/wp-includes/script-loader.php
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 1dd43e9393..4a0417901d 100644
a b function wp_localize_community_events() { 1757 1757 'nonce' => wp_create_nonce( 'community_events' ), 1758 1758 'cache' => $events_client->get_cached_events(), 1759 1759 'time_format' => get_option( 'time_format' ), 1760 1761 'l10n' => array( 1762 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ), 1763 'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ), 1764 'attend_event_near_generic' => __( 'Attend an upcoming event near you.' ), 1765 1766 /* 1767 * These specific examples were chosen to highlight the fact that a 1768 * state is not needed, even for cities whose name is not unique. 1769 * It would be too cumbersome to include that in the instructions 1770 * to the user, so it's left as an implication. 1771 */ 1772 /* 1773 * translators: %s is the name of the city we couldn't locate. 1774 * Replace the examples with cities related to your locale. Test that 1775 * they match the expected location and have upcoming events before 1776 * including them. If no cities related to your locale have events, 1777 * then use cities related to your locale that would be recognizable 1778 * to most users. Use only the city name itself, without any region 1779 * or country. Use the endonym (native locale name) instead of the 1780 * English name if possible. 1781 */ 1782 'could_not_locate_city' => __( 'We couldn’t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ), 1783 1784 // This one is only used with wp.a11y.speak(), so it can/should be more brief. 1785 /* translators: %s: The name of a city. */ 1786 'city_updated' => __( 'City updated. Listing events near %s.' ), 1787 ), 1760 1788 ) 1761 1789 ); 1762 1790 } -
tests/phpunit/tests/admin/includesCommunityEvents.php
diff --git a/tests/phpunit/tests/admin/includesCommunityEvents.php b/tests/phpunit/tests/admin/includesCommunityEvents.php index 6b84790334..b0280dd92e 100644
a b class Test_WP_Community_Events extends WP_UnitTestCase { 280 280 * 281 281 * @covers WP_Community_Events::trim_events 282 282 * 283 * @since 5. 5.2283 * @since 5.6.0 284 284 */ 285 285 public function test_trim_expired_events() { 286 286 $trim_events = new ReflectionMethod( $this->instance, 'trim_events' ); … … class Test_WP_Community_Events extends WP_UnitTestCase { 309 309 * @covers WP_Community_Events::trim_events 310 310 * 311 311 * @since 4.9.7 312 * @since 5. 5.2Tests `trim_events()` directly instead of indirectly via `get_events()`.312 * @since 5.6.0 Tests `trim_events()` directly instead of indirectly via `get_events()`. 313 313 */ 314 314 public function test_trim_events_pin_wordcamp() { 315 315 $trim_events = new ReflectionMethod( $this->instance, 'trim_events' ); … … class Test_WP_Community_Events extends WP_UnitTestCase { 331 331 * Simulates a scenario where a WordCamp needs to be pinned higher than it's default position. 332 332 * 333 333 * @since 4.9.7 334 * @since 5. 5.2Accepts and returns only the events, rather than an entire HTTP response.334 * @since 5.6.0 Accepts and returns only the events, rather than an entire HTTP response. 335 335 * 336 336 * @return array A list of mock events. 337 337 */ … … class Test_WP_Community_Events extends WP_UnitTestCase { 414 414 * @covers WP_Community_Events::trim_events 415 415 * 416 416 * @since 4.9.7 417 * @since 5. 5.2Tests `trim_events()` directly instead of indirectly via `get_events()`.417 * @since 5.6.0 Tests `trim_events()` directly instead of indirectly via `get_events()`. 418 418 */ 419 419 public function test_trim_events_dont_pin_multiple_wordcamps() { 420 420 $trim_events = new ReflectionMethod( $this->instance, 'trim_events' ); … … class Test_WP_Community_Events extends WP_UnitTestCase { 437 437 * no need to pin extra camp b/c one already exists in response 438 438 * 439 439 * @since 4.9.7 440 * @since 5. 5.2Tests `trim_events()` directly instead of indirectly via `get_events()`.440 * @since 5.6.0 Tests `trim_events()` directly instead of indirectly via `get_events()`. 441 441 * 442 442 * @return array A mock HTTP response. 443 443 */ -
tests/phpunit/tests/general/document-title.php
diff --git a/tests/phpunit/tests/general/document-title.php b/tests/phpunit/tests/general/document-title.php index a15f926ea9..8117106582 100644
a b 1 1 <?php 2 2 3 3 /** 4 * A set of unit tests for functions in wp-includes/general-template.php4 * A set of unit tests for testing the Document Title functions in wp-includes/general-template.php 5 5 * 6 * @group general 6 7 * @group template 7 8 * @group document-title 9 * @ticket 46227 8 10 */ 9 11 class Tests_General_DocumentTitle extends WP_UnitTestCase { 10 12 … … class Tests_General_DocumentTitle extends WP_UnitTestCase { 275 277 function _change_title_separator( $sep ) { 276 278 return '%%'; 277 279 } 278 } 280 281 // Test adding custom feed link to the blog page in the header. 282 function test_add_feed_link_to_header_front_page() { 283 $test_title = 'Blog'; 284 // create a sample blog page. 285 $blog_page_id = $this->factory->post->create( 286 array( 287 'post_title' => $test_title, 288 'post_type' => 'page', 289 ) 290 ); 291 292 update_option( 'page_for_posts', $blog_page_id ); 293 update_option( 'show_on_front', 'page' ); 294 295 $this->go_to('/'); 296 297 $doc = new DOMDocument(); 298 $doc->preserveWhiteSpace = false; 299 300 $test_link_str = '<link rel="feed" type="text/html" href="' . get_the_permalink( $blog_page_id ) . '" title="' . the_title_attribute( array( 'echo' => false, 'post' => $blog_page_id ) ) . '" />'; 301 $doc->loadHTML( $test_link_str ); 302 303 $selector = new DOMXPath( $doc ); 304 $result = $selector->query( "/html/head/link[@rel= 'feed']" ); 305 $test_blog_title = $result->item(0)->getAttribute( 'title' ); 306 307 $this->assertEquals( $test_blog_title, $test_title ); 308 } -
deleted file tests/qunit/fixtures/common.js
diff --git a/tests/qunit/fixtures/common.js b/tests/qunit/fixtures/common.js deleted file mode 100644 index 79e9ae5019..0000000000
+ - 1 /**2 * Mock the deprecateL10nObject() for tests.3 *4 * deprecateL10nObject() is part of wp-admin/js/common.js which requires5 * some HTML markup to exist. Instead of adding all the markup this adds6 * a noop version of deprecateL10nObject(). This makes it possible7 * to test wp-admin/js/dashboard.js.8 */9 window.wp = window.wp || {};10 window.wp.deprecateL10nObject = function () {}; -
tests/qunit/index.html
diff --git a/tests/qunit/index.html b/tests/qunit/index.html index 4b7ecaebd2..e06ddc4bcb 100644
a b 82 82 <script src="fixtures/wp-api-generated.js"></script> 83 83 <script src="fixtures/js-widgets-endpoint.js"></script> 84 84 <script src="fixtures/wp-api.js"></script> 85 <script src="fixtures/common.js"></script>86 85 </div> 87 86 88 87 <!-- Tested files -->