Commit Graph

19530 Commits

Author SHA1 Message Date
Sergey Biryukov
3ec2d2fcfa Build/Test Tools: Update PHPCompatibilityWP to version 2.1.3.
The latest release takes the new polyfills added in WordPress 5.9 into account.

This commit also removes redundant inline ignore comments for WP-polyfilled functionality. The PHPCompatibilityWP ruleset explicitly excludes those polyfills, so they don't need to be annotated as ignored.

Release notes:
https://github.com/PHPCompatibility/PHPCompatibilityWP/releases/tag/2.1.3

For a full list of changes in this update, see the PHPCompatibilityWP GitHub:
https://github.com/PHPCompatibility/PHPCompatibilityWP/compare/2.1.2...2.1.3

Follow-up to [46290], [51543].

Props jrf.
Fixes #54711.
Built from https://develop.svn.wordpress.org/trunk@52425


git-svn-id: http://core.svn.wordpress.org/trunk@52017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-31 13:55:03 +00:00
John Blackbourn
678f2ceb0d Docs: Miscellaneous inline documentation improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52422


git-svn-id: http://core.svn.wordpress.org/trunk@52014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 17:28:00 +00:00
Sergey Biryukov
05a3e19924 Plugins: Escape the WordPress.org plugin page URL in the Plugin Installation modal.
Follow-up to [8540], [38953].

Props chintan1896, Presskopp, dimadin, henry.wright, aezazshekh, SergeyBiryukov.
Fixes #54362.
Built from https://develop.svn.wordpress.org/trunk@52419


git-svn-id: http://core.svn.wordpress.org/trunk@52011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-27 16:06:02 +00:00
Sergey Biryukov
ef7cf47ec4 Administration: Make sure the $customize_url variable is always defined in the admin menu.
This avoids an `Undefined variable` PHP warning when displaying other admin menu items.

Follow-up to [52069], [52134], [52158], [52178], [52414].

Props afragen.
Fixes #54682.
Built from https://develop.svn.wordpress.org/trunk@52415


git-svn-id: http://core.svn.wordpress.org/trunk@52007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:32:03 +00:00
Sergey Biryukov
4a22a4cec3 Editor: Add missing default template areas to the post/page editor settings.
This ensures that default template area settings are displayed when editing a template in the post/page editor, which previously got lost during backporting for 5.9.

Follow-up to [52232].

Props Mamaduka, costdev, gziolo.
Fixes #54679.
Built from https://develop.svn.wordpress.org/trunk@52409


git-svn-id: http://core.svn.wordpress.org/trunk@52001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-22 13:00:03 +00:00
hellofromTonya
673ab8a677 Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin  Editor menu item from Plugins to Tools for block themes for a consistent workflow.

Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes. 

Follow-up to [52232].

Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406


git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:06:02 +00:00
hellofromTonya
28b0710360 Application Passwords: Show HTTPS required message without filtering when not enabled or not in local environment.
When `add_filter( 'wp_is_application_passwords_available', '__return_false' )` exists, HTTPS requirement message is shown even if HTTPS is enabled on the site. This happens because `wp_is_application_passwords_available_for_user()` first invokes `wp_is_application_passwords_available()` which is filterable. The situation could happen if the `'wp_is_application_passwords_available_for_user'` filter returns `false`.

To fix this, the check for HTTPS (or if in a 'local' environment) is moved to a new function called `wp_is_application_passwords_supported()`. Then the return from this function is used as an OR condition for the Application Passwords section and for displaying the HTTPS required message.

Tests are included for both `wp_is_application_passwords_supported()` and `wp_is_application_passwords_available()`.

Follow-up to [51980], [51988].

Props davidbinda, SergeyBiryukov, ocean90, felipeelia, costdev, hellofromTonya.
Fixes #53658.
Built from https://develop.svn.wordpress.org/trunk@52398


git-svn-id: http://core.svn.wordpress.org/trunk@51990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 02:45:03 +00:00
audrasjb
8698dc9721 Site Health: Typo correction in Site Health help tab.
Follow-up to [52053].

Props pedromendonca.
Fixes #54656.

Built from https://develop.svn.wordpress.org/trunk@52385


git-svn-id: http://core.svn.wordpress.org/trunk@51977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:02:04 +00:00
hellofromTonya
65a4199149 Themes: Rename public static functions in WP_Theme_JSON_Resolver to remove custom_post_type references.
WordPress Core is not really custom and does not reference "custom post type" in its function naming. This commit renames 2 public static methods:

* `WP_Theme_JSON_Resolver::get_user_custom_post_type_id()` renamed to `WP_Theme_JSON_Resolver::get_user_global_styles_post_id()`.
* `WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type()` renamed to `WP_Theme_JSON_Resolver:: get_user_data_from_wp_global_styles()`.

Follow-up to [52049], [52051], [52069], [52232], [52275], [52364].

Props antonvlasenko, bernhard-reiter, costdev, desrosj, hellofromTonya, noisysocks, oandregal, SergeyBiryukov.
Fixes #54517.
Built from https://develop.svn.wordpress.org/trunk@52372


git-svn-id: http://core.svn.wordpress.org/trunk@51964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:14:01 +00:00
hellofromTonya
edf755823b Customize: Overlay incompatible banner for block themes.
Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.

Non-block themes are not affected by this change and continue to work in Customizer.

Follow-up to [41648], [41893], [52279].

Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.
Built from https://develop.svn.wordpress.org/trunk@52371


git-svn-id: http://core.svn.wordpress.org/trunk@51963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 15:33:01 +00:00
noisysocks
935058d178 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.

Built from https://develop.svn.wordpress.org/trunk@52364


git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 01:57:26 +00:00
Sergey Biryukov
d09d194f12 Docs: Capitalize "ID", when referring to a widget ID or sidebar ID, in a more consistent way.
Follow-up to [48104], [52357], [52361].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52362


git-svn-id: http://core.svn.wordpress.org/trunk@51954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-13 10:21:07 +00:00
audrasjb
f4683efbc9 Docs: Document the global used in upgrade_590() function.
Follow-up to [51917].

See #53399.

Built from https://develop.svn.wordpress.org/trunk@52360


git-svn-id: http://core.svn.wordpress.org/trunk@51952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 17:57:00 +00:00
Sergey Biryukov
6cb050d878 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
Follow-up to [48104].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52357


git-svn-id: http://core.svn.wordpress.org/trunk@51949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:54:00 +00:00
Sergey Biryukov
75fc6b755b Docs: Update a comment in wp-admin/load-styles.php per the documentation standards.
Follow-up to [52352].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52356


git-svn-id: http://core.svn.wordpress.org/trunk@51948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:52:02 +00:00
hellofromTonya
f847144952 Themes: Show only "Customize" or "Activate" button in block theme's Theme Details modal.
At the bottom of a block theme's "Theme Details" modal, only one button will be displayed:
* "Customize" button when the block theme is activated;
* Else, the "Activate" button.

The "Live Preview", "Editor beta", and "Navigation Menus" buttons are removed.

Follow-up to [15646], [52341], [52346].

Props poena, ryelle, kafleg, antonvlasenko, costdev, SergeyBiryukov, hellofromTonya.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52353


git-svn-id: http://core.svn.wordpress.org/trunk@51945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:33:00 +00:00
Sergey Biryukov
3beb1d25ab Docs: Correct the format of some comments per the documentation standards.
Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52352


git-svn-id: http://core.svn.wordpress.org/trunk@51944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:30:05 +00:00
Peter Wilson
88b1019dc3 Upgrade/install: Revert upgrader rollback features.
Revert the rollback features introduced for theme and plugin upgrades during the WordPress 5.9 cycle. A bug (suspected to be in third party virtualisation software) causes the upgrades to fail consistently on some set ups. The revert is to allow contributors further time to investigate mitigation options.

Reverts [52337], [52289], [52284], [51951], [52192], [51902], [51899], [51898], [51815].

Props pbiron, dlh, peterwilsoncc, galbaras, SergeyBiryukov, afragen, costdev, bronsonquick, aristath, noisysocks, desrosj, TobiasBg, hellofromTonya, francina, Boniu91.
See #54543, #54166, #51857.



Built from https://develop.svn.wordpress.org/trunk@52351


git-svn-id: http://core.svn.wordpress.org/trunk@51943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 00:06:04 +00:00
Sergey Biryukov
62574145ce Coding Standards: Use camel case with a lowercase first letter for the blockTheme array key.
This matches the WordPress JS naming conventions and the naming of other keys in the `$prepared_themes` array.

Follow-up to [52341].

See #54578, #53359.
Built from https://develop.svn.wordpress.org/trunk@52346


git-svn-id: http://core.svn.wordpress.org/trunk@51938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-08 10:16:05 +00:00
hellofromTonya
9aba2584bb Themes: Hide "Live Preview" button for FSE block themes.
Currently, the Site Editor does not have a live preview feature for non-activated block themes.

This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense.

Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52341


git-svn-id: http://core.svn.wordpress.org/trunk@51933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:07:00 +00:00
hellofromTonya
4f0c8ef665 Upgrade/Install: Fix moving plugins folder in WP_Upgrader:: move_to_temp_backup_dir().
[51815] introduced the creation of a temporary backup of plugins before updating.

The `move()` (and later, `move_dir()`) call) uses a `$src` parameter.
For Hello Dolly, this is `<path>/wp-contents/plugins/.` (note the period at the end).

For users on Linux and Mac, this doesn't appear to cause any problems.
However, on Windows, the move causes the plugins folder to be moved which then causes a failure when attempting to call `mkdir()`.

This commit skips any plugin whose slug is `'.'` as this slug results in the `$src` value ending in a period. 

Follow-up to [51815].

Props costdev, boniu91, hellofromTonya.
Fixes #54543.
Built from https://develop.svn.wordpress.org/trunk@52337


git-svn-id: http://core.svn.wordpress.org/trunk@51929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:51:03 +00:00
youknowriad
ec25c4ee57 Site Editor: Render the template descriptions properly.
The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.

Built from https://develop.svn.wordpress.org/trunk@52336


git-svn-id: http://core.svn.wordpress.org/trunk@51928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:40:01 +00:00
hellofromTonya
177a4d830b REST API: Pass post type name to rest_get_route_for_post_type_items().
The new `rest_get_route_for_post_type_items()` function accepts a string, not an object. This commit passes the post type name instead of the object to resolve a notice in the site editor page.

Follow-up to [52281].

Props walbo.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52333


git-svn-id: http://core.svn.wordpress.org/trunk@51925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:15:02 +00:00
John Blackbourn
39bff93b6b Docs: Various inline documentation corrections and improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52332


git-svn-id: http://core.svn.wordpress.org/trunk@51924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:20:02 +00:00
hellofromTonya
f70fb51f99 Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.
This commit renames the following method and function to better represent block theme terminology:

* `WP_Theme::is_block_based()` to `WP_Theme::is_block_theme()`
* `wp_is_block_template_theme()` to `wp_is_block_theme()`

It also changes `wp_is_block_theme()` to be a helper wrapper (sugar syntax) for `wp_get_theme()->is_block_theme();`. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

Follow-up to [52069], [52247], [52279].

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52330


git-svn-id: http://core.svn.wordpress.org/trunk@51922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 00:02:02 +00:00
John Blackbourn
9a982b4ae8 Docs: Various docblock corrections.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52299


git-svn-id: http://core.svn.wordpress.org/trunk@51891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 12:17:00 +00:00
audrasjb
15d7d368f3 Docs: Docblock corrections in _disable_block_editor_for_navigation_post_type().
Follow-up to [52145].

See #53399.

Built from https://develop.svn.wordpress.org/trunk@52298


git-svn-id: http://core.svn.wordpress.org/trunk@51890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 11:41:59 +00:00
hellofromTonya
2b2313d56b Editor: Hide visibility and status settings for wp_navigation post type.
Adds CSS to hide both the visibility and status settings for the `wp_navigation` post type.

Props antonvlasenko , costdev. 
Fixes #54407.
Built from https://develop.svn.wordpress.org/trunk@52293


git-svn-id: http://core.svn.wordpress.org/trunk@51885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:01:02 +00:00
Sergey Biryukov
576116927b Upgrade/Install: Make some adjustments to the move_dir() function:
* Check for direct PHP flle access and only use `rename()` if true.
* Check whether the destination directory was successfully created.
* Clear the working directory so there is internal parity within the function between the results of a successful `rename()` and a fallback to `copy_dir()`.
* Use `move_dir()` in `WP_Upgrader::move_to_temp_backup_dir()` and `::restore_temp_backup()`.

Follow-up to [51815], [51898], [51899], [51902], [52192], [52284].

Props afragen, peterwilsoncc, dd32, SergeyBiryukov.
See #54166, #51857.
Built from https://develop.svn.wordpress.org/trunk@52289


git-svn-id: http://core.svn.wordpress.org/trunk@51881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:12:00 +00:00
hellofromTonya
5c414db9ad External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50547].

Props chaion07, Clorith, costdev, desrosj, malthert, peterwilsoncc, presskopp, promz, sabernhardt, SergeyBiryukov, toro_unit, wpnomad.
Fixes #51519.
Built from https://develop.svn.wordpress.org/trunk@52285


git-svn-id: http://core.svn.wordpress.org/trunk@51877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:18:01 +00:00
Sergey Biryukov
5e35ad4b4a Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the temp-backup directory.
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

This addresses a  `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled.

Follow-up to [51815], [51898], [51899], [51902], [52192].

Props dlh, pbiron.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52284


git-svn-id: http://core.svn.wordpress.org/trunk@51876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:12:01 +00:00
hellofromTonya
14f6cf230b REST API: Replace hardcoded wp/v2/ preloaded paths with rest_get_route_for_taxonomy_items() and rest_get_route_for_post_type_items() in wp-admin/site-editor.php.
[51962] and [51964] introduced two new functions: `rest_get_route_for_post_type_items()` and `rest_get_route_for_taxonomy_items()`. These functions replaced hardcoded references in all parts of core that reference taxonomy and post type rest controller endpoints. However, several instances were missed in the `wp-admin/site-editor.php` file.

This commit replaces those remaining hardcoded instances.

Follow-up to [51962], [51964], [52232].

Props spacedmonkey.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52281


git-svn-id: http://core.svn.wordpress.org/trunk@51873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:54:03 +00:00
hellofromTonya
ce3aed3186 Administration: For block themes, link to Site Editor interface instead of Customizer in Dashboard's welcome panel and Themes interface.
For block themes (like Twenty Twenty-Two), Customizer menu item is removed and replaced with the Site Editor menu item. However, other links exist in the Dashboard's welcome panel "Customize Your Site" button and the "Customize" button in each theme listed in the Appearance > Themes interface.

This commit changes each of those remaining links to link to the Site Editor interface instead of the Customizer.

To help identify block vs non-block themes, two method methods are introduced in `WP_Theme`:

* `WP_Theme:: is_block_based()` which identifies if the theme is a block theme or not.
* `WP_Theme::get_file_path()` which is similar to `get_theme_file_path()` but uses the directories within the theme object.

Both of these new methods include test coverage including the addition of a parent and child block theme in test data.

Follow-up to [18749], [35483], [42013], [42169].

Props antonvlasenko, jameskoster, hellofromTonya, matveb, noisysocks, poena, sergeybiryukov.
Fixes #54460.
Built from https://develop.svn.wordpress.org/trunk@52279


git-svn-id: http://core.svn.wordpress.org/trunk@51871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 14:27:03 +00:00
noisysocks
e4b553a201 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Update Pattern block category and add documentation
- Fix non existent menu handling in nav block
- Make Reusable blocks available in the Site Editor
- Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()
- theme.json: add appearanceTools flag to opt-in into appearance UI controls
- Update the block theme folders to templates and parts
- Remove reference to gutenberg_, swap with wp_
- Use table layout in templates list screen
- Update featured image placeholder graphic.
- [Inserter]: Adjust order of theme blocks and reorder inserter items
- Implement suitable fallback for Nav block on front end of site when no menu selected
- Toggle Group Control: add tooltip
- Use first non-empty Nav post as primary fallback for Nav block
- Change .nvmrc and documentation for Node.js version (LTS to 14.18.1)
- Update: Migrate global styles user database data on the rest endpoint
- Update global styles public API
- Update: Rename user preset origin to custom
- Try always generating navigation post title
- Show all templates and template parts on the site editor list screens
- Highlight "Site" in the navigation panel
- Fix template part slug generation when creating through the block placeholder
- [Block Library - Post Title]: Fix render error when setting Page to homepage
- Add 'Clear customizations' button to template list page
- Gallery v1: Allow clicks within replace media placeholder state
- Site Editor: Set the <title> on the list page to be same as the CPT name
- Gallery: Fix stuck image size options loader
- Cover: Fix undo trap
- Add success and error snackbars to the templates list page
- Fix: theme colors cannot override defaults
- Fix: Color palette is not being stored
- Add elements support to the typography panel in global styles
- Make links plural in global styles
- Add: Gradient palette editor
- Update some small style regressions in the template list
- Add: Transparency support on global styles colors
- Fix: apply by slug on all origins
- Render empty Nav block if no fallback block can be utilised
- Allow filtering of Nav block fallback
- Fix Nav block fallback DB query to match on full block grammar start tag
- Remove unstable max pages attribute from Nav block
- DateTimePicker: set PM hours correctly
- Update delete template button
- Site Editor: Template list add rename action
- Fix Nav block editing wrong entity on creation of new Menu
- [REST] Restore the missing double slash in the ID received by /templates
- Add icons to navigation sidebar items
- Update function names for the public global styles API functions
- Templates Controller: Add missing 'is_custom' prop
- Rename gutenberg_ to wp_ for some functions that land in WordPress 5.9
- [Block Library - Template Part]:Remove support for conversion to Reusable block
- Global Styles: Call "palettes" and not "color palettes" on panel label
- Add button text when no colors found
- Update: Global Styes: Count all color palette origins on the palette counter
- Rename navigationMenuId to ref
- Offset the parent iframe when computing Popover position 
- Fix: Failing PHPUnit test
- Show theme, plugin or author in Added By column with appropriate icon or avatar
- Add origin and author to template rest api

See #54487.
Props talldanwp, mamaduka, oandregal.

Built from https://develop.svn.wordpress.org/trunk@52275


git-svn-id: http://core.svn.wordpress.org/trunk@51867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 00:24:27 +00:00
spacedmonkey
ebf7eb50dc Editor: Remove Navigation Areas
Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.


Built from https://develop.svn.wordpress.org/trunk@52272


git-svn-id: http://core.svn.wordpress.org/trunk@51864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 22:06:01 +00:00
hellofromTonya
677e6e5b13 Media: Fix TypeError and improve wp_exif_frac2dec() to only return int or float.
For certain images, `wp_exif_frac2dec()` unexpectedly returned a string instead of `int` or `float`. This can occur when an image is missing meta and calls the function with `'0/0'`. For those images, a fatal error was thrown on PHP 8.0+:

{{{
TypeError: round(): Argument #1 ($num) must be of type int|float, string given
}}}

Upon deeper review, inconsistent and unexpected results were returned from different types of input values passed to the function.

Changes are:

* Maintains backwards-compatibility for valid input values.
* Fixes handling of invalid input values by bailing out to return the documented type of `int|float` by returning `0`.
* Improves the fractional conditional check.
* Improves the calculated fraction handling to ensure (a) the numerator and denominator are both numeric and (b) the denominator is not equal to zero.
* Safeguards the behavior via tests for all possible ways code could flow through the function.
* Safeguards the backwards-compatibility of the `wp_read_image_metadata()` by adding some defensive coding around the calls to the `wp_exif_frac2dec()` function.

These changes fix the fatal error and make the function more secure, stable, and predictable while maintaining backwards-compatibility for valid input values.

Follow-up to [6313], [9119], [22319], [28367], [45611], [47287].

Props adamsilverstein, jrf, peterwilsoncc, praem90, stevegs, tobiasbg.
Fixes #54385.
Built from https://develop.svn.wordpress.org/trunk@52269


git-svn-id: http://core.svn.wordpress.org/trunk@51861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 19:36:05 +00:00
Sergey Biryukov
7cbc31f7c0 Docs: Remove inaccurate part of the screen_settings filter description.
The filter is called for all admin screens, not just the Widgets screen.

Follow-up to [27256].

Props Starbuck.
Fixes #54524.
Built from https://develop.svn.wordpress.org/trunk@52257


git-svn-id: http://core.svn.wordpress.org/trunk@51849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 02:07:00 +00:00
Sergey Biryukov
70f43f261b External Libraries: Update getID3 to version 1.9.21.
The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes:
* Setting the `$options_audiovideo_quicktime_ReturnAtomData` property (now `false` by default) to `true` in `wp_read_video_metadata()` and `wp_read_audio_metadata()` in order to get the `created_timestamp` value.
* PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.
Built from https://develop.svn.wordpress.org/trunk@52254


git-svn-id: http://core.svn.wordpress.org/trunk@51846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 03:06:03 +00:00
Sergey Biryukov
fe2a2ef0e4 Docs: Improve consistency of some DocBlocks in wp-admin/includes/post.php.
Follow-up to [52249].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52251


git-svn-id: http://core.svn.wordpress.org/trunk@51843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 00:28:03 +00:00
audrasjb
b0743f17e1 Docs: Miscellaneous DocBlock corrections in wp-admin/includes/post.php.
See #53399.

Built from https://develop.svn.wordpress.org/trunk@52249


git-svn-id: http://core.svn.wordpress.org/trunk@51841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 20:39:00 +00:00
audrasjb
f69b6a04fb Media: Replace some array keys with their numeric equivalent.
This change replaces `['0']` with `[0]` which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.

Built from https://develop.svn.wordpress.org/trunk@52245


git-svn-id: http://core.svn.wordpress.org/trunk@51837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 08:35:09 +00:00
Sergey Biryukov
dfdbbb4e62 Docs: Miscellaneous DocBlock corrections.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@52242


git-svn-id: http://core.svn.wordpress.org/trunk@51834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 23:59:59 +00:00
audrasjb
c66d278da5 Docs: Document the globals used in some Privacy API methods.
See #53399.

Built from https://develop.svn.wordpress.org/trunk@52239


git-svn-id: http://core.svn.wordpress.org/trunk@51831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 11:41:03 +00:00
John Blackbourn
92f0b0cb48 Docs: Various docblock corrections and improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52236


git-svn-id: http://core.svn.wordpress.org/trunk@51828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 21:37:01 +00:00
noisysocks
121c824ccd Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.

Built from https://develop.svn.wordpress.org/trunk@52232


git-svn-id: http://core.svn.wordpress.org/trunk@51824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 05:40:38 +00:00
Sergey Biryukov
d2c41142ed Editor: Check the correct post type support property for initial_edits.
The property to check should be `editor` instead of `content`, as posts don't have a `content` support property.

This addresses an e2e test failure in Gutenberg.

Follow-up to [52230].

Props talldanwp.
See #53813.
Built from https://develop.svn.wordpress.org/trunk@52231


git-svn-id: http://core.svn.wordpress.org/trunk@51823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-22 08:42:03 +00:00
audrasjb
9ee35e14c2 Editor: Do not provide initial_edits for properties that are not supported by the current post type.
Previously, the block editor initialization always provided "title", "content" and "excerpt" initial edits in the `initializeEditor` call even though these properties might not be supported by the current post type being edited. This leads to a bug in the post editor where as soon as one would open a "new post", the editor considers the content "dirty", meaning changes are applied and it is not possible to leave the editor without encountering an "unsaved changes" notice.

This change updates the `$initial_edits` variable declaration to only provide the properties that are supported by the current post type.

Props youknowriad, h71.
Fixes #53813.

Built from https://develop.svn.wordpress.org/trunk@52230


git-svn-id: http://core.svn.wordpress.org/trunk@51822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-21 19:28:03 +00:00
Sergey Biryukov
c9ecd13aca Coding Standards: Wrap some long lines in js/_enqueues/admin/post.js per the JS coding standards for better readability.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@52228


git-svn-id: http://core.svn.wordpress.org/trunk@51820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:49:58 +00:00
Sergey Biryukov
742cd201e6 Docs: Update documentation for the $plugin_data parameter of various hooks:
* Document the structure of the `$plugin_data` array passed to the `plugin_row_meta` filter.
* Document some missing values returned by `get_plugin_data()`:
 * `PluginURI`
 * `AuthorName`
* Link to `get_plugin_data()` and the `plugin_row_meta` filter as the canonical sources in other various filters and actions which receive the `$plugin_data` parameter:
 * `network_admin_plugin_action_links`
 * `network_admin_plugin_action_links_{$plugin_file}`
 * `plugin_action_links`
 * `plugin_action_links_{$plugin_file}`
 * `plugin_auto_update_setting_html`
 * `manage_plugins_custom_column`
 * `after_plugin_row`
 * `after_plugin_row_{$plugin_file}`
 * `in_plugin_update_message-{$file}`
* Update documentation for the `$response` parameter of the `in_plugin_update_message-{$file}` filter:
 * Correct type for the `id` value. It contains a string like `w.org/plugins/[plugin-name]`, not a numeric ID.
 * Update `$icons`, `$banners`, and `$banners_rtl` values to use typed array notation.

Follow-up to [8367], [8402], [12976], [16758], [26540], [30544], [34818], [51733], [52212], [52224].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52227


git-svn-id: http://core.svn.wordpress.org/trunk@51819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:23:02 +00:00
audrasjb
1bd5af61d2 Editor: Add missing label to new-post-slug input on Classic Editor.
Previously, the input for changing the permalink of a post does not have a label in the Classic Editor. This change adds a visually hidden label. It also makes sure browsers do not run spellcheck on the input field.

Props sabernhardt.
Fixes #53725.

Built from https://develop.svn.wordpress.org/trunk@52225


git-svn-id: http://core.svn.wordpress.org/trunk@51817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:55:59 +00:00
Sergey Biryukov
966c7376b4 Docs: Restore [51733], accidentally reverted in [52212].
Document some more `$response` values in the `in_plugin_update_message-{$file}` filter:
* `banners_rtl`
* `requires_php`

Follow-up to [51733], [52212].

Fixes #40006.
Built from https://develop.svn.wordpress.org/trunk@52224


git-svn-id: http://core.svn.wordpress.org/trunk@51816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:16:58 +00:00
desrosj
9d86fba4db Docs: Remove instances of the “eg.” abbreviation in favor of “example” or “for example”.
See #53330.
Built from https://develop.svn.wordpress.org/trunk@52215


git-svn-id: http://core.svn.wordpress.org/trunk@51807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:44:01 +00:00
desrosj
b0b9e23c70 Upgrade/Install: Improve the accuracy of the auto_update_{$type} filter docblock.
This updates the filter documentation for `auto_update_{$type}` to account for the changes to default auto-update behaviors made in WordPress 5.6.

Starting in WordPress 5.6, all new installs auto-update major versions by default.

Props felipeloureirosantos, audrasjb, marybaum, davidbaumwald.
Fixes #53330.
Built from https://develop.svn.wordpress.org/trunk@52214


git-svn-id: http://core.svn.wordpress.org/trunk@51806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:19:59 +00:00
audrasjb
9f91a2a245 Docs: Add missing parameters in in_plugin_update_message-{$file} filter.
Follow-up to [51733].

Props costdev, audrasjb, SergeyBiryukov.
Fixes #40006.

Built from https://develop.svn.wordpress.org/trunk@52212


git-svn-id: http://core.svn.wordpress.org/trunk@51804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 23:19:08 +00:00
John Blackbourn
40626108d0 Docs: Corrections relating to types used in inline documentation for comment ID and site ID proprties.
Includes a correction for a typo introduced in [52204].

See #53399

Built from https://develop.svn.wordpress.org/trunk@52205


git-svn-id: http://core.svn.wordpress.org/trunk@51797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:57:01 +00:00
John Blackbourn
c9746ab584 Docs: Various corrections and improvements relating to types used in inline documentation.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52204


git-svn-id: http://core.svn.wordpress.org/trunk@51796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:50:05 +00:00
audrasjb
b3b8d6959c Upgrade/Install: Add timezone info to last checked update time.
The time displayed on the Updates screen matches the server time which may not be the timezone the person viewing the page is in. This change includes the timezone information with the time.

Props mkaz.
Fixes #53554.

Built from https://develop.svn.wordpress.org/trunk@52203


git-svn-id: http://core.svn.wordpress.org/trunk@51795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 09:25:03 +00:00
audrasjb
03b59ce449 Posts, Post Types: Increment post_count option value only on multisite installations.
Avoid the `post_count` option to be created on single-site installations.

Follow-up to [52201].

Props dlh, henry.wright.
Fixes #54462.

Built from https://develop.svn.wordpress.org/trunk@52202


git-svn-id: http://core.svn.wordpress.org/trunk@51794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 00:20:59 +00:00
audrasjb
cbac37d16d Posts, Post Types: Increment post_count option value during blog creation.
Previously, the `post_count` option value was not incremented when the default "Hello world!" post is inserted during blog creation on a multisite installation.

Props henry.wright.
Fixes #54462.
See #53443.

Built from https://develop.svn.wordpress.org/trunk@52201


git-svn-id: http://core.svn.wordpress.org/trunk@51793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 23:08:03 +00:00
hellofromTonya
d4b3deddda Upgrade/Install: Remove 5.8 function and fix deactivate Gutenberg plugin version compare < 11.9.
Follow-up to [52165] where the `version_compare()` fails for 11.8.x versions. This commit changes the version comparison to < 11.9 for deactivating the Gutenberg plugin. 

The `_upgrade_580_force_deactivate_incompatible_plugins()` function is no longer needed in 5.9. It's redundant and unnecessary as `_upgrade_590_force_deactivate_incompatible_plugins()` deactivates those versions as well.

Removing `_upgrade_580_force_deactivate_incompatible_plugins()` and moving the deactivation logic back into the `_deactivate_gutenberg_when_incompatible_with_wp()`, thus removing the new private function `_deactivate_gutenberg_when_incompatible_with_wp()` introduced in [52165].

Follow-up [51180], [51266], [52165].

Props hellofromTonya, tobiasbg, clorith, sergeybiryukov, costdev.
Fixes #54405. 
Built from https://develop.svn.wordpress.org/trunk@52199


git-svn-id: http://core.svn.wordpress.org/trunk@51791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 17:45:00 +00:00
audrasjb
1589bba4f5 Upgrade/Install: Differentiate en_US version strings from localized ones.
Adds a condition to `$version_string` to determine whether the Core update is the original en_US package, or a localized one.

This change fixes an issue where these packages were not differentiated and duplicate messages were displayed.

Props Presskopp, benjamingosset.
Fixes #53710.

Built from https://develop.svn.wordpress.org/trunk@52197


git-svn-id: http://core.svn.wordpress.org/trunk@51789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 16:24:00 +00:00
joedolson
74395140ad Media: Move dismiss upload errors button after errors.
Change the button that dismissess upload errors so it appears after the relevant errors. Change button from icon-only to text-based. Removes ambiguity about what you are cancelling when using the control.

Props ComputerGuru, melchoyce, vdwijngaert, alexislloyd, joedolson, shaunandrews, sabernhardt.
Fixes #42979.

Built from https://develop.svn.wordpress.org/trunk@52196


git-svn-id: http://core.svn.wordpress.org/trunk@51788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 15:56:03 +00:00
audrasjb
0a8b1555b8 Login and Registration: auto-focus the reset password field.
Although auto-focusing form fields can be arguable in some cases, it makes sense when there is a very specific task to accomplish and when there is no relevant content before the auto-focused field.

This change brings consistency between various forms generated by `wp-login.php`.

Props afercia, donmhico, sabernhardt.
Fixes #40302.

Built from https://develop.svn.wordpress.org/trunk@52193


git-svn-id: http://core.svn.wordpress.org/trunk@51785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 00:14:01 +00:00
Sergey Biryukov
8a5e1aa0b3 Upgrade/Install: Correct the weekly cron event for clearing the temp-backup directory:
* Make sure the `wp_delete_temp_updater_backups` event has an action associated with it when it runs.
* Check if the cron event already exists before scheduling it, to avoid scheduling duplicate events. 
* Move the code for clearing the `temp-backup` directory to a standalone function.

Follow-up to [51815], [51898], [51899].

Props pbiron, johnbillion.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52192


git-svn-id: http://core.svn.wordpress.org/trunk@51784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 22:19:59 +00:00
ryelle
4a18ff86c9 Themes: Force a scrollbar on the Themes page to prevent visual shake on hover.
On some browser & window size combinations (near where a scrollbar would appear), hovering over the theme card causes a layout shift. This makes the screen visually "jump" as the scrollbar appears and disappears. By forcing the scrollbar to be visible on this page, hovering doesn't cause the layout shift anymore.

Props wparslan, sabernhardt, costdev, audrasjb.
Fixes #53478.


Built from https://develop.svn.wordpress.org/trunk@52185


git-svn-id: http://core.svn.wordpress.org/trunk@51777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 17:18:00 +00:00
hellofromTonya
c5518c2f11 Taxonomy: Allow get_*_*_link() and edit_term_link() functions to accept a term ID, WP_Term, or term object.
`get_term()` accepts a term ID, instance of `WP_Term`, or an object (i.e. `stdClass` as a result of a db query). Functions that use `get_term()` also now allow for the same data types.

Why? For consistency, removing extra processing code in consuming functions, and performance.

Functions changed in this commit are:
* `get_category_feed_link()`
* `get_term_feed_link()`
* `get_tag_feed_link()`
* `get_edit_tag_link()`
* `get_edit_term_link()`
* `edit_term_link()`

For each of consumer of these functions, changes to pass the object instead of the term ID.

Includes unit/integration tests for test coverage of these changes.

Follow-up to [6365], [9136], [9340], [14711], [15792], [15800], [18827], [32606], [36646], [37252].

Props davidbinda, johnbillion, peterwilsoncc, hellofromTonya, sergeybiryukov, mista-flo, hareesh-pillai, audrasjb, jeffpaul, chaion07.
Fixes #50225.
Built from https://develop.svn.wordpress.org/trunk@52180


git-svn-id: http://core.svn.wordpress.org/trunk@51772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:57:02 +00:00
hellofromTonya
9cf709d6b6 Administration: Restores "Customize" menu item for non-block themes and moves for block themes.
For themes without non-block themes (i.e. without a `/block-templates/index.html` file), restores the "Customize" menu item under "Appearance" menu to its original location of `6`.

For block themes, moves it to position `8`, as "Styles" is in position `7` as of [52158].

Follow-up to [29026], [52069], [52158].

Props poena, davidbaumwald, sabernhardt, hellofromTonya.
Fixes #54418.
Built from https://develop.svn.wordpress.org/trunk@52178


git-svn-id: http://core.svn.wordpress.org/trunk@51770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 04:45:00 +00:00
hellofromTonya
3f7dbfd6a9 Widgets: Wraps long widget titles in classic Widgets screen.
Follow-up to [18577], [26426].

Props afercia, bravokeyl, drewapicture, gkloveweb, hitendra-chopda, hellofromTonya, ianhayes94, ovann86, pankajmohale, poena, sabrib, swissspidy, xkon.
Fixes #37451.
Built from https://develop.svn.wordpress.org/trunk@52177


git-svn-id: http://core.svn.wordpress.org/trunk@51769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 03:17:58 +00:00
hellofromTonya
a393ec95a5 Login and Registration: Wrap long usernames in login error message.
Adds `word-wrap: break-word` to wrap long usernames in the login's error message. Using `word-wrap` instead of `word-break` for better cross-browser support and to avoid the deprecation (see Ref below).

For consistency, also changes `#backtoblog`.

Ref:
* `word-break: break-word` deprecation https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#syntax

Follow-up to [51108].

Props soniakash, audrasjb, sabernhardt, hellofromTonya, desrosj, ocean90.
Fixes #37617.
Built from https://develop.svn.wordpress.org/trunk@52174


git-svn-id: http://core.svn.wordpress.org/trunk@51766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 01:56:58 +00:00
joedolson
9cb60e437f Coding Standards: Revert accidental image changes in [52171].
Reverts images changed in [52171].

Follow up to [52171].

See #54168.

Built from https://develop.svn.wordpress.org/trunk@52172


git-svn-id: http://core.svn.wordpress.org/trunk@51764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 00:04:01 +00:00
joedolson
3b1d5aec7c Media: Revert media uploader input change in [52059].
Based on follow-up research, this change was never necessary in order to use e2e tests in the media library uploader. Additionally, it created several complicated side effects. Without significant benefit, it's not valuable to pursue the change further.

Follow up to [52059].

See #54168, #54411.
Fixes #54168.
Built from https://develop.svn.wordpress.org/trunk@52171


git-svn-id: http://core.svn.wordpress.org/trunk@51763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 23:22:02 +00:00
joedolson
dbc8d76a9f Taxonomy: Display update notices when adding terms.
Display notice and announce to screen readers when a new term is added. 

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.

Built from https://develop.svn.wordpress.org/trunk@52170


git-svn-id: http://core.svn.wordpress.org/trunk@51762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:24:01 +00:00
joedolson
06e7a012b1 Commit Standards: Revert [52168] to correct commit message.
Used incorrect commit message..

Follow up to [52168].

See #42937.
Built from https://develop.svn.wordpress.org/trunk@52169


git-svn-id: http://core.svn.wordpress.org/trunk@51761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:18:00 +00:00
joedolson
b07f107447 Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available.

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.
Built from https://develop.svn.wordpress.org/trunk@52168


git-svn-id: http://core.svn.wordpress.org/trunk@51760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 21:55:00 +00:00
joedolson
6912dc20b9 Menus: Add audible notice on menu item add or remove.
Call `wp.a11y.speak()` to add audible notification when a menu item is added or removed from a menu.

Props joedolson, costdev, hellofromTonya.
Fixes #53840.
Built from https://develop.svn.wordpress.org/trunk@52166


git-svn-id: http://core.svn.wordpress.org/trunk@51758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 20:00:59 +00:00
hellofromTonya
1f608d5d5c Upgrade/Install: Deactivate the Gutenberg plugin if its version is 11.8 or lower.
Avoid a fatal error due to `WP_Theme_JSON_Schema` and potentially other classes and/or functions redeclarations when updating to WordPress 5.9 with an incompatible version of the Gutenberg plugin.

This commit uses the same strategy from 5.8. Moves the plugin deactivation code (introduced in [51266]) to a private function for reuse in 5.8, 5.9, and future major releases.

Follow-up to [51180], [51266].

Props hellofromTonya, johnbillion, jorbin.
See #54405.
Built from https://develop.svn.wordpress.org/trunk@52165


git-svn-id: http://core.svn.wordpress.org/trunk@51757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 19:59:03 +00:00
Sergey Biryukov
9ac09f5a67 Taxonomy: Clarify the taxonomy labels for customizing the field descriptions on Edit Tags screen:
* Update the label names to make it clear that these descriptions are not for the term name or slug itself, but for the Name, Slug, Parent, and Description fields:
 * `name_field_description`
 * `slug_field_description`
 * `parent_field_description`
 * `desc_field_description`
* Update the array structure to make it clear that the default values for these labels are the same for both hierarchical and non-hierarchical taxonomies, with the exception of `parent_field_description`.
* Add documentation and a `@since` note for the new labels.

Follow-up to [52094].

Fixes #43060.
Built from https://develop.svn.wordpress.org/trunk@52163


git-svn-id: http://core.svn.wordpress.org/trunk@51755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 16:45:01 +00:00
noisysocks
c2d0fb2040 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Navigation: Fix click-button size, submenu directions, scrollbars.
- Group - Fix overzealous regex when restoring inner containers
- Babel Preset: Update Babel packages to 7.16 version
- theme.json: adds a setting property that enables some other ones
- Polish metabox container.
- Fix submenu justification and spacer orientation.
- Fix Gutenberg 11.8.2 in WordPress trunk
- Strip meta tags from pasted links in Chromium
- Hide visilibility and status for navigation posts
- Navigation: Refactor and simplify setup state.
- Nav block menu switcher - decode HTML entities and utilise accessible markup pattern
- Rename fse_navigation_area to wp_navigation_area
- theme.json: adds a setting property that enables some other ones
- Revert "theme.json: adds a setting property that enables some other ones"
- Skip flaky image block test
- WordPress/gutenberg@3c935c4
- React to any errors coming up in gutenberg_migrate_menu_to_navigation_post
- Return wp error from wp_insert_post
- Fix not transforming logical assignments for packages

See #54337.

Built from https://develop.svn.wordpress.org/trunk@52161


git-svn-id: http://core.svn.wordpress.org/trunk@51753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 12:50:17 +00:00
noisysocks
892da9af91 Editor: Fix fatal call to add_query_args()
It should be add_query_arg(), not add_query_args().

Follows [52145].
See #54337.
Props sabernhardt.

Built from https://develop.svn.wordpress.org/trunk@52159


git-svn-id: http://core.svn.wordpress.org/trunk@51751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 06:19:01 +00:00
noisysocks
40cd53a573 Editor: Fix how the Site Editor is linked to
- Add 'Edit site' to the top admin bar.
- Link to the Template and Template Part CPTs.
- Add deep link to the Global Styles UI.

Follows [52069].
See #54337.

Built from https://develop.svn.wordpress.org/trunk@52158


git-svn-id: http://core.svn.wordpress.org/trunk@51750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 03:43:59 +00:00
noisysocks
93d4851bbf Editor: Add Navigation Area infrastructure
Copies Navigation Area infrastrucutre from lib/navigation.php in Gutenberg. This
allows a Navigation block to be associated with a particular area which persists
when switching theme.

Props antonvlasenko, mamaduka, spacedmonkey.
See #54337.

Built from https://develop.svn.wordpress.org/trunk@52145


git-svn-id: http://core.svn.wordpress.org/trunk@51737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 03:55:01 +00:00
davidbaumwald
00403bc675 Posts, Post Types: Update _edit_last meta when posts are edited in bulk.
When posts are edited in bulk, the `_edit_last` meta was not updated for each post.  This change adds a call to update the `_edit_last` meta to the current user ID for each post the is updated.

Props calebwoodbridge, peterwilsoncc, guillaumeturpin, audrasjb.
Fixes #42446.
Built from https://develop.svn.wordpress.org/trunk@52141


git-svn-id: http://core.svn.wordpress.org/trunk@51733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 19:09:00 +00:00
joedolson
356fe8c2dd Upgrade/Install: Update screen reader text counts in adminbar.
Update the hidden screen-reader-text update count in the adminbar when updates are run on the plugin or theme screens.

Props pento, paulschreiber, adamsilverstein, afercia, SergeyBiryukov, sabernhardt.
Fixes #29022.
Built from https://develop.svn.wordpress.org/trunk@52139


git-svn-id: http://core.svn.wordpress.org/trunk@51731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 17:20:58 +00:00
Peter Wilson
37c02eb5fe Taxonomy: Change some static strings to registration labels.
Add additional label options to `register_taxonomy()` to allow developers further flexibility for customizing the edit taxonomy screen.

Props mclaurent, swissspidy, johnbillion, jeremyescott, theMikeD, jeremyfelt, dontgo2sleep, SergeyBiryukov, audrasjb, Boniu91.
Fixes #43060.


Built from https://develop.svn.wordpress.org/trunk@52094


git-svn-id: http://core.svn.wordpress.org/trunk@51686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:46:00 +00:00
desrosj
1dac2cdae7 Themes: Twenty Twenty-Two is now the default theme.
It's Friday night, and I feel alright. The party is here in the block theme.

See #54318.
Built from https://develop.svn.wordpress.org/trunk@52093


git-svn-id: http://core.svn.wordpress.org/trunk@51685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:41:00 +00:00
Peter Wilson
951ec3905d Quick/Bulk Edit: Disable auto-correct for slugs.
Disable auto-correct for the slug field on the quick/bulk edit interface. As slugs may consist of a number of words combined in to a single string, they are unlikely to pass spell checkers.

Props swb1192, SergeyBiryukov, afragen, Clorith, desrosj, JeffPaul, sabernhardt, Boniu91, costdev, hellofromTonya.
Fixes #50499.


Built from https://develop.svn.wordpress.org/trunk@52092


git-svn-id: http://core.svn.wordpress.org/trunk@51684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:02:59 +00:00
davidbaumwald
d5f7417686 Bootstrap/Load: Add HTTP/3 as a valid HTTP protocol.
As of November 2021, the `HTTP/3` protocol is still officially an Internet Draft, but is already supported by 74% of running web browsers and, according to W3Techs, 23% of the top 10 million websites. It has been supported by Google Chrome (including Chrome for Android, and Microsoft Edge, which is based on it) since April 2020 and by Mozilla Firefox since May 2021. Safari 14 (on macOS Big Sur and iOS 14) has also implemented the protocol but support is hidden behind a feature flag.

Based on the wide support, this change adds `HTTP/3` as a valid HTTP protocol.

Props malthert.
Fixes #54404.
Built from https://develop.svn.wordpress.org/trunk@52087


git-svn-id: http://core.svn.wordpress.org/trunk@51679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:07:01 +00:00
Sergey Biryukov
878c7c0486 Coding Standards: Use strict comparison in wp-admin/includes/ms.php.
Props davidbaumwald, audrasjb.
Fixes #47422.
Built from https://develop.svn.wordpress.org/trunk@52086


git-svn-id: http://core.svn.wordpress.org/trunk@51678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:06:01 +00:00
youknowriad
55840750c5 Site Editor: Load as full screen by default.
To avoid UI jumps when loading the page, the site-editor.php page
is marked as full screen by default. 
This also matches the behavior of the post editor.

See #54337.

Built from https://develop.svn.wordpress.org/trunk@52071


git-svn-id: http://core.svn.wordpress.org/trunk@51663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 09:14:02 +00:00
noisysocks
c421e9b34a Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

Built from https://develop.svn.wordpress.org/trunk@52069


git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:17:17 +00:00
antpb
975f56e42b Media: Change upload button to a file input for better e2e targeting.
Changes the media library upload button to `input type="file"` for better end to end testing capabilities.

Props  justinahinon, joedolson, sabernhardt, audrasjb.
Fixes #54168.


Built from https://develop.svn.wordpress.org/trunk@52059


git-svn-id: http://core.svn.wordpress.org/trunk@51651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:49:00 +00:00
joedolson
d00b86ff06 I18N: Add language switcher on login/registration screens.
Load a language switcher on the login and registration screens that allows users to choose any already-installed language. Set user locale on registration.

Props johnbillion, Nikschavan, afercia, sabernhardt, garrett-eclipse, keyur5, paaljoachim, Clorith, tobifjellner.
Fixes #43700.
Built from https://develop.svn.wordpress.org/trunk@52058


git-svn-id: http://core.svn.wordpress.org/trunk@51650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:37:59 +00:00
johnjamesjacoby
65866fa233 Admin/Help: add commas to end of multi-line array items.
Follow up to r52053.

See #54357.
Built from https://develop.svn.wordpress.org/trunk@52055


git-svn-id: http://core.svn.wordpress.org/trunk@51647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:55:00 +00:00
jorgefilipecosta
d8fe393934 Add: Public functions for interacting with global styles & settings.
This commit ports the public functions to interact with the global styles & settings.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52054


git-svn-id: http://core.svn.wordpress.org/trunk@51646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:45:58 +00:00
johnjamesjacoby
8dfb59d4de Admin/Help: add docs links to several screens.
This change intends to better guide users towards many of the useful resources available on WordPress.org.

* Appearance/Customizer - Add link to Customizer docs.
* Appearance/Editor - Improve link text & destination.
* Privacy Settings - Link to Privacy Settings docs.
* Site Health - Link to Site Health docs.

Props audrasjb, jdy68, webcommsat.

Fixes #54357.
Built from https://develop.svn.wordpress.org/trunk@52053


git-svn-id: http://core.svn.wordpress.org/trunk@51645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:43:01 +00:00
desrosj
c2a7d2a773 Themes: Remove temporary Full Site Editing safety checks.
These checks were added in [51193] and [51197] as a temporary measure to prevent a site owner from activating a Full Site Editing theme when Gutenberg plugin was not active.

Because Core only had partial support for the features required for FSE, the front end of the site would display a white screen or error message to visitors. Unless the site owner visited the front end, there would be no indication that there was a problem.

Since 5.9 will include the remaining features required for FSE, these checks can be removed.

Props poena, jffng.
Fixes #54366. See #534190.
Built from https://develop.svn.wordpress.org/trunk@52044


git-svn-id: http://core.svn.wordpress.org/trunk@51636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:27:59 +00:00
John Blackbourn
2a3ad7c430 Docs: Various docblock improvements and corrections.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52035


git-svn-id: http://core.svn.wordpress.org/trunk@51627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 10:48:59 +00:00
antpb
3dc76d614a Media: Adjust alt text info link text.
Previous messaging of this link was confusing given it went to an external source. This change describes more accurately that it will perform the action of taking you to the resource.

Props karmatosed, joedolson, melchoyce, hellofromTonya, afercia, sabernhardt, antpb.
Fixes #48939.


Built from https://develop.svn.wordpress.org/trunk@52033


git-svn-id: http://core.svn.wordpress.org/trunk@51625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 00:22:57 +00:00
antpb
c1f6817cad Media: Remove security messaging in media upload failures.
Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.


Built from https://develop.svn.wordpress.org/trunk@52032


git-svn-id: http://core.svn.wordpress.org/trunk@51624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:29:56 +00:00
joedolson
201f4ddfbe Editor: Update structure of title element for editing.
Re-format the title element for post editing to follow general scheme for WordPress admin screens.

Props SergeyBiryukov.
Fixes #52314.
Built from https://develop.svn.wordpress.org/trunk@52030


git-svn-id: http://core.svn.wordpress.org/trunk@51622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 22:09:56 +00:00
Clorith
44f50060eb Site Health: Add the constant WP_ENVIRONMENT_TYPE for debug data.
As a legacy from the old Health Check plugin, the constant `WP_LOCAL_DEV` was included in the debug data under the "WordPress Constants" section. This was incorrect, and has never been a constant used by core.

Instead, that field is now replaced by `WP_ENVIRONMENT_TYPE`, which was introduced with WordPress 5.5, and is a much more appropriate value to provide in a debug scenario.

Props johnbillion, bgoewert, sabbirshouvo.
Fixes #54340.
Built from https://develop.svn.wordpress.org/trunk@52021


git-svn-id: http://core.svn.wordpress.org/trunk@51613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 21:05:00 +00:00
Sergey Biryukov
0531cc11b4 Coding Standards: Consistently escape attribute in wp-admin/themes.php.
Follow-up to [27012], [38057], [47816], [51083].

Props sabbirshouvo, audrasjb.
Fixes #54256.
Built from https://develop.svn.wordpress.org/trunk@52020


git-svn-id: http://core.svn.wordpress.org/trunk@51612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 17:58:57 +00:00
hellofromTonya
b9d15392bf Code Modernization: Pass correct default value to http_build_query() in get_core_checksums() and wp_version_check().
The `get_core_checksums()` and `wp_version_check()` functions call the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a non-nullable `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.

In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

References:
* [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]

Follow-up to [18697], [25540].

Props bjorsch, kraftbj, hellofromTonya, jrf.
See #54229.
Built from https://develop.svn.wordpress.org/trunk@52019


git-svn-id: http://core.svn.wordpress.org/trunk@51611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 12:18:58 +00:00
Clorith
500da91f70 Site Health: Update the icon used when no issues are reported.
The icon used to be a rather blocky checkmark, but has now been changed to the more friendly, and less ambiguous, smiley dashicon.

It also helps cover a rare cases where a checkmark, while often used to mark something as done, may also be used to indicate that something is incorrect (many thanks to my 6th grade teacher for this rationale).

As an added bonus, this commit also adjusts the margins used around the icon, to make it fit more nicely on both large and small viewports.

Props sabernhardt, generosus.
Fixes #53980.
Built from https://develop.svn.wordpress.org/trunk@52018


git-svn-id: http://core.svn.wordpress.org/trunk@51610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 11:41:01 +00:00
hellofromTonya
9036739acc Administration: Make dashboard widget control submit button text more clear.
Changes the submit button text from "Submit" to "Save Changes".

Why? The text is more semantic and clear of what happens when activating that button.

Follow-up to [9103].

Props zodiac1978, knutsp, hilayt24, audrasjb.
Fixes #54229.
Built from https://develop.svn.wordpress.org/trunk@52014


git-svn-id: http://core.svn.wordpress.org/trunk@51605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 23:30:58 +00:00
davidbaumwald
2e249395de Comments: Add noopener noreferrer to author links in list table.
When viewing the listing of all comments, author links previously passed referrer information to untrusted URLs.  This change adds `noreferrer` to each author link, as well as `noopener` to prevent the passing of information about the parent window.

Props cybr, adam3128, erayalakese, andraganescu, audrasjb, joedolson, sabernhardt. 
Fixes #40916.
Built from https://develop.svn.wordpress.org/trunk@52007


git-svn-id: http://core.svn.wordpress.org/trunk@51596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 20:02:02 +00:00
Sergey Biryukov
aa62c253e0 External Libraries: Update the Iris color picker to version 1.1.1.
The latest version includes jQuery 3.x deprecation fixes:
* `$.isArray` → `Array.isArray`
* Event attachment/trigger shorthands → `.on()` and `.trigger()`

For a full list of changes in this update, see the PR on GitHub:
https://github.com/Automattic/Iris/pull/72

Follow-up to [22030], [22033], [22385], [22457], [22697], [22732], [23443], [26334], [30551], [30650], [38931], [50547].

Props Clorith, mattwiebe, Cybr.
Fixes #54224.
Built from https://develop.svn.wordpress.org/trunk@52006


git-svn-id: http://core.svn.wordpress.org/trunk@51595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 19:40:00 +00:00
hellofromTonya
6a10d18458 Customize: Fix focus() to collapse child panels and show parent panel.
When a child panel is open, `wp.customize.panel('parent_panel').focus()` (e.g. `'parent_parent'` might be `'nav_menus'`) collapses the child panel(s) to show the parent panel. 

Follow-up to [30102], [31920], [38648].

Props celloexpressions, costdev, dlh, hareesh-pillai, hellofromTonya, westonruter, wpweaver. 
Fixes #34436.
Built from https://develop.svn.wordpress.org/trunk@52003


git-svn-id: http://core.svn.wordpress.org/trunk@51592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 15:05:58 +00:00
Sergey Biryukov
a59ade2290 Help/About: Improve typography in the Welcome to your WordPress Dashboard! text.
Per the general consensus in #8714 and similar tickets, user-facing strings should use “curly quotes” for better typography.

Remove the `svn:executable` property that appears to be added accidentally.

Follow-up to [38049], [42200], [46585], [51995].

See #54321.
Built from https://develop.svn.wordpress.org/trunk@52001


git-svn-id: http://core.svn.wordpress.org/trunk@51590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 03:16:57 +00:00
hellofromTonya
b87617e271 Customizer: Make range controls full width.
Adds CSS for range controls in the Customizer to be as wide as possible allowing for smaller increments to be more easily obtained by the user.

Follow-up to [28930].

Props domainsupport, dlh, sabernhardt, audrasjb.
Fixes #54329.
Built from https://develop.svn.wordpress.org/trunk@51996


git-svn-id: http://core.svn.wordpress.org/trunk@51585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 23:19:59 +00:00
hellofromTonya
22e4a52258 Help/About: Improve the Welcome text in wp-admin/_index.php.
Improves the `Welcome to your WordPress Dashboard!` copy in the `Overview` section of the help tab.

Follow-up to [18914], [19007], [37680].

Props webcommsat, marybaum, costdev, audrasjb.
Fixes #54321.
Built from https://develop.svn.wordpress.org/trunk@51995


git-svn-id: http://core.svn.wordpress.org/trunk@51584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 22:54:59 +00:00
hellofromTonya
3819fa7340 Help/About: Simplifies WordPress version in "Help" sidebar.
Simplifies the logic for when not in alpha/beta/RC.

The changelog URL is translatable in a few other places in core. This commit uses the same pattern for consistency.

Follow-up to [51985].

Props sergeybiryukov.
Fixes #47848.
Built from https://develop.svn.wordpress.org/trunk@51991


git-svn-id: http://core.svn.wordpress.org/trunk@51580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 21:43:57 +00:00
Sergey Biryukov
1fdea15a96 Coding Standards: Fix some WPCS errors and warnings in wp-admin/user-edit.php:
* Add missing translators comment.
* Add missing space, correct indentation.
* Put opening and closing PHP tag on a line by itself.
* Remove unnecessary escaping for consistency with other strings.

Follow-up to [51980].

See #53658.
Built from https://develop.svn.wordpress.org/trunk@51988


git-svn-id: http://core.svn.wordpress.org/trunk@51577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 20:19:59 +00:00
johnjamesjacoby
88e9e36233 Help/About: add WordPress version to contextual "Help" sidebar area.
This change adds a new way for users to quickly identify what version of WordPress they are looking at, directly from the "Help" sidebar on the main "Dashboard" page.

* Stable versions will link to their respective support documents.
* Development versions (alpha/beta/RC) will not link anywhere.

Props audrasjb, costdev, donmhico, hellofromtonya, ipstenu, justinahinon, karmatosed, knutsp, marybaum, sergeybiryukov, webcommsat.

Fixes #47848.
Built from https://develop.svn.wordpress.org/trunk@51985


git-svn-id: http://core.svn.wordpress.org/trunk@51574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 19:09:03 +00:00
Sergey Biryukov
3ab8d52d78 Media: Use WP_Query::get() method to retrieve the posts_per_page value in wp_ajax_query_attachments().
This avoids a PHP notice and ensures that a default value is always provided if none is set by the user.

Follow-up to [51145], [51485].

Props davidwebca, mukesh27.
Fixes #54129.
Built from https://develop.svn.wordpress.org/trunk@51982


git-svn-id: http://core.svn.wordpress.org/trunk@51571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 18:30:02 +00:00
johnjamesjacoby
fae48afc92 Application Passwords: display guiding text & link in user-edit.php when unavailable.
This change intends to avoid confusion around the requirements of the Application Passwords feature, specific to it requiring HTTPS and the `WP_ENVIRONMENT_TYPE` constant.

It does this by conditionally hiding the traditional UI and showing some insightful explanations instead, including a translatable link to the `WP_ENVIRONMENT_TYPE` documentation on the "Editing wp-config.php" support page.

Props ashfame, audrasjb, iluy, johnbillion.

Fixes  #53658.
Built from https://develop.svn.wordpress.org/trunk@51980


git-svn-id: http://core.svn.wordpress.org/trunk@51569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:57:03 +00:00
johnjamesjacoby
6d451fb64b Admin/UI-Copy: reword some "we" usages.
This changes some admin-area, user-facing text, to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word “we” should be avoided (...) unless its made very clear which group is speaking

(There are several more usages of "we" that will receive this same scrutiny in future commits/releases.)

Props audrasjb, johnbillion, marybaum, peterwilsoncc, sergeybiryukov, shital-patel.

Fixes  #46057.
Built from https://develop.svn.wordpress.org/trunk@51979


git-svn-id: http://core.svn.wordpress.org/trunk@51568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:37:57 +00:00
johnjamesjacoby
f60dae0731 Admin/Menu: include 960 exact pixel width in collapse measurements.
This change removes a 1 pixel gap in the measurement of the viewport width when clicking the "Collapse menu" button (at the bottom of the admin menu UI) when already collapsed, causing the menu not to open as intended when exactly 960 pixels wide.

Before this change, the menu would be stuck in the collapsed position. After this change, the menu opens as expected.

Props abesell132, ankit-k-gupta, audrasjb, boniu91, mai21, sabernhardt, webaxones.

Fixes #54210.
Built from https://develop.svn.wordpress.org/trunk@51977


git-svn-id: http://core.svn.wordpress.org/trunk@51566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:07:57 +00:00
johnjamesjacoby
dd7cb532a1 Admin/Discussion Settings: attempt to clarify intent of "Default post settings" section.
This changes the descriptive text underneath 3 settings that are frequently overridden by individual posts & pages, and are also often misunderstood to work differently than they do.

"(These settings may be overridden for individual posts.)"

...becomes...

"Individual posts may override these settings. Changes here will only be applied to new posts."

* Parenthesis were removed to improve text layout and flow for RTL languages.
* Original statement was reworded to emphasize "individual posts".
* New statement provides clarity to users about settings changes not being retroactive.

Props audrasjb, johnjamesjacoby, sabbirshouvo, sabernhardt, tobifjellner.

Fixes #54300.
Built from https://develop.svn.wordpress.org/trunk@51976


git-svn-id: http://core.svn.wordpress.org/trunk@51565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 16:42:59 +00:00
johnjamesjacoby
791998fb7c Admin/Comments: remove bespoke truncation from search string HTML.
This change removes a call to `wp_html_excerpt()` used on the HTML output of the search string, supplied by the current user in the previous page request via the named `s` input in the search-box UI.

If the search string is extremely long, it wraps around the available empty space in a way that is not visually displeasing, confirming that truncation is not a requirement here.

This also addresses a small accessibility concern as the non-truncated string was not alternatively presented, and helps normalize the output of `$_REQUEST['s']` for more broad improvements in the future.

Props hareesh-pillai, jakubtyrcha, johnjamesjacoby, lukecavanagh, sabernhardt.

Fixes #17636.
Built from https://develop.svn.wordpress.org/trunk@51975


git-svn-id: http://core.svn.wordpress.org/trunk@51564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 15:57:59 +00:00
joedolson
c90e2fe4f2 Widgets: Remove unused CSS breaking wp_text_diff layout.
Remove CSS used in version of `wp_text_diff` prior to [50034]. Orphaned CSS breaks default layout of function output, but is overridden in the revisions screen.

Props mt8.biz, hareesh-pillai, mukesh27.
Fixes #54140.
Built from https://develop.svn.wordpress.org/trunk@51972


git-svn-id: http://core.svn.wordpress.org/trunk@51561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 23:14:00 +00:00
joedolson
67779da49f Widgets: Use a text-based button to select location.
The WordPress Events and News widget used an icon-only button to select a location. The Pencil icon alone provided insufficient context and labeling for accessibility. Add text to clearly describe button action and change icon to represent a location marker. 

Props AmethystAnswers, sabernhardt.
Fixes #53311.
Built from https://develop.svn.wordpress.org/trunk@51971


git-svn-id: http://core.svn.wordpress.org/trunk@51560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:54:57 +00:00
hellofromTonya
69dc72d0b9 Site Health: Internationalizes count in the info section headings.
If a site health info section includes the `show_count` parameter, this commit internationalizes the count.

Follow-up to [45176].

Props johnbillion, swissspidy.
Fixes #54341.
Built from https://develop.svn.wordpress.org/trunk@51970


git-svn-id: http://core.svn.wordpress.org/trunk@51559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:36:59 +00:00
joedolson
a841368a3e Editor: Include post's title in editor title element.
Include the current post title in the `title` element when editing a post. Improve accessibility by distinguishing between different edit screens in the browser tab list. 

Props skierpage, alexstine, audrasjb, sabernhardt.
Fixes #52314.
Built from https://develop.svn.wordpress.org/trunk@51969


git-svn-id: http://core.svn.wordpress.org/trunk@51558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:32:58 +00:00
joedolson
a3a61c5a3e General: Remove role="navigation" from nav elements.
Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.
Built from https://develop.svn.wordpress.org/trunk@51967


git-svn-id: http://core.svn.wordpress.org/trunk@51556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 21:47:13 +00:00
TimothyBlynJacobs
bac6e41c85 REST API: Support custom namespaces for custom post types.
While a custom post type can define a custom route by using the `rest_base` argument, a namespace of `wp/v2` was assumed. This commit introduces support for a `rest_namespace` argument. 

A new `rest_get_route_for_post_type_items` function has been introduced and the `rest_get_route_for_post` function updated to facilitate getting the correct route for custom post types.

While the WordPress Core Block Editor bootstrap code has been updated to use these API functions, for maximum compatibility sticking with the default `wp/v2` namespace is recommended until the API functions see wider use.

Props spacedmonkey, swissspidy.
Fixes #53656.

Built from https://develop.svn.wordpress.org/trunk@51962


git-svn-id: http://core.svn.wordpress.org/trunk@51551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-31 23:16:58 +00:00
John Blackbourn
c274d3c520 Docs: Miscellaneous docblock improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@51957


git-svn-id: http://core.svn.wordpress.org/trunk@51546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-30 20:17:01 +00:00
Sergey Biryukov
4459eaf392 Docs: Further update the debug_information filter description per the documentation standards.
Specifically, this ensures that the DocBlock follows the line wrapping recommendations.

Follow-up to [44986], [45156], [45259], [51949].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51956


git-svn-id: http://core.svn.wordpress.org/trunk@51545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-30 13:41:02 +00:00
John Blackbourn
6babc3833b Docs: Miscellaneous docblock improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@51955


git-svn-id: http://core.svn.wordpress.org/trunk@51544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 23:13:05 +00:00
Sergey Biryukov
0e2f9ad5b6 Coding Standards: Correct alignment in WP_Site_Health::get_test_update_temp_backup_writable().
This fixes an `Equals sign not aligned with surrounding assignments; expected 1 space but found 6 spaces` WPCS warning.

Follow-up to [51815].

See #51857, #53359.
Built from https://develop.svn.wordpress.org/trunk@51951


git-svn-id: http://core.svn.wordpress.org/trunk@51540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 16:52:57 +00:00
John Blackbourn
a0d8a60547 Site Health: Correct and improve the documentation for the debug_information hook.
This corrects the structure of the documentation so it accurately reflects the array elements contained within.

See #53399.

Built from https://develop.svn.wordpress.org/trunk@51949


git-svn-id: http://core.svn.wordpress.org/trunk@51538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 15:35:00 +00:00
joedolson
d71ae9a7e3 Administration: Hide mobile menu on focusout.
Closes the admin menu on mobile devices when keyboard focus moves outside of the menu or menu toggle elements. Improves the usability of the menu on mobile by allowing closure anywhere outside the menu rather than only on the toggle. 

Props kaneva, costdev, sabernhardt
Fixes #53587.
Built from https://develop.svn.wordpress.org/trunk@51946


git-svn-id: http://core.svn.wordpress.org/trunk@51535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 17:28:56 +00:00
Pascal Birchler
a225165010 Role/Capability: Add support for capability queries in WP_User_Query.
Similar to the existing `role`/`role__in`/`role__not_in` query arguments, this adds support for three new query arguments in `WP_User_Query`:

* `capability` 
* `capability__in`
* `capability__not_in`

These can be used to fetch users with (or without) a specific set of capabilities, for example to get all users
with the capability to edit a certain post type.

Under the hood, this will check all existing roles on the site and perform a `LIKE` query against the `capabilities` user meta field to find:

* all users with a role that has this capability
* all users with the capability being assigned directly

Note: In WordPress, not all capabilities are stored in the database. Capabilities can also be modified using filters like `map_meta_cap`. These new query arguments do NOT work for such capabilities.

The prime use case for capability queries is to get all "authors", i.e. users with the capability to edit a certain post type.

Until now, `'who' => 'authors'` was used for this, which relies on user levels. However, user levels were deprecated a long time ago and thus never added to custom roles. This led to constant frustration due to users with custom roles missing from places like author dropdowns.

This updates any usage of `'who' => 'authors'` in core to use capability queries instead.

Subsequently, `'who' => 'authors'` queries are being **deprecated** in favor of these new query arguments.

Also adds a new `capabilities` parameter (mapping to `capability__in` in `WP_User_Query`) to the REST API users controller.

Also updates `twentyfourteen_list_authors()` in Twenty Fourteen to make use of this new functionality, adding a new `twentyfourteen_list_authors_query_args` filter to make it easier to override this behavior.

Props scribu, lgladdly, boonebgorges, spacedmonkey, peterwilsoncc, SergeyBiryukov, swissspidy.
Fixes #16841.

Built from https://develop.svn.wordpress.org/trunk@51943


git-svn-id: http://core.svn.wordpress.org/trunk@51532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 18:43:57 +00:00
johnjamesjacoby
7a0a07d691 Admin/HTTP API: add suggested filename support to download_url().
This change allows for external clients to supply a suggested filename via a `Content-Disposition` response header. This filename is processed through `sanitize_file_name()` to ensure it is allowable (on the server, MIME's, etc...) and `validate_file()` to prevent directory traversal.

If the suggested filename fails the above processing/checks, that suggestion is discarded and the standard temporary filename (generated by WordPress) is used.

If no `Content-Disposition` header is found in the response headers, the standard temporary filename continues to be used as per normal.

Included in this change are 6 additional PHPUnit tests with 9 assertions. These tests confirm that valid filename values are correctly saved, and invalid filename values are correctly rejected.

Props cklosows, costdev, dd32, johnjamesjacoby, ocean90, psrpinto.

Fixes #38231.
Built from https://develop.svn.wordpress.org/trunk@51939


git-svn-id: http://core.svn.wordpress.org/trunk@51528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 15:00:01 +00:00
Sergey Biryukov
e6ede0c816 Coding Standards: Improve escaping in wp-admin/theme-install.php.
* Rename a duplicate `$feature_name` variable to `$feature_group` for clarity.
* Escape the remaining `$feature_name` variable.

Follow-up to [27636], [35273].

Props sabbirshouvo, sabernhardt, mukesh27, afragen.
Fixes #54277.
Built from https://develop.svn.wordpress.org/trunk@51923


git-svn-id: http://core.svn.wordpress.org/trunk@51516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 19:18:01 +00:00
Sergey Biryukov
2c84d63322 Help/About: Don't output empty <span> tags on Credits screen.
If the contributor does not have a title, the empty tags are not necessary.

Follow-up to [17877], [17909], [17942], [18162], [19143], [46709].

Props sayedulsayem, audrasjb, mukesh27.
Fixes #54275.
Built from https://develop.svn.wordpress.org/trunk@51920


git-svn-id: http://core.svn.wordpress.org/trunk@51513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-19 23:09:00 +00:00
hellofromTonya
234877c9c3 Coding Standards: Add public visibility to methods in src directory.
This commit adds the `public` visibility keyword to each method which did not have an explicit visibility keyword.

Why `public`?

With no visibility previously declared, these methods are implicitly `public` and available for use. Changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf.
See #54177.
Built from https://develop.svn.wordpress.org/trunk@51919


git-svn-id: http://core.svn.wordpress.org/trunk@51512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 17:52:58 +00:00
hellofromTonya
db3a05178b Cron: Remove errant false values in cron array when upgrading to 5.9+.
[51916] fixed a bug where `array( `false` )` was added to the cron array when `_get_cron_array()` returned `false`. 

This commit:
* Removes any `false` values from the cron array when upgrading to 5.9+.
* Bumps the database version.

Follow-up to [44917], [51916].

Props peterwilsoncc, jrf.
See #53950.
Built from https://develop.svn.wordpress.org/trunk@51917


git-svn-id: http://core.svn.wordpress.org/trunk@51510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 13:30:57 +00:00
Sergey Biryukov
cea5785cdb Coding Standards: Consistently escape form action URL in wp-admin/update-core.php.
Follow-up to [10166], [23739], [25806].

Props sabbirshouvo, mukesh27.
Fixes #54278.
Built from https://develop.svn.wordpress.org/trunk@51914


git-svn-id: http://core.svn.wordpress.org/trunk@51507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-17 20:31:02 +00:00
Sergey Biryukov
8b8b5d8ecc Media: Display the unsaved changes dialog in image edit form using jQuery .text() function.
This ensures that HTML entities like non-breaking spaces are properly displayed instead of being encoded.

Props jdy68, sebastienserre, audrasjb, mukesh27, SergeyBiryukov.
Fixes #54232.
Built from https://develop.svn.wordpress.org/trunk@51907


git-svn-id: http://core.svn.wordpress.org/trunk@51500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 00:18:56 +00:00
Sergey Biryukov
1020306fe9 I18N: Add context for some Media Library filter strings:
* Audio
* Video
* Unattached

This allows for more homogeneous translations in languages where keeping a plural form is important.

Follow-up to [6910], [7397], [8901], [9556], [11749], [13100], [12110], [15491], [15578], [22743], [29426], [29625], [34256], [45651], [46437].

Props jdy68, audrasjb, SergeyBiryukov.
Fixes #54238.
Built from https://develop.svn.wordpress.org/trunk@51903


git-svn-id: http://core.svn.wordpress.org/trunk@51496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-12 16:44:01 +00:00
Sergey Biryukov
2030b6e313 Upgrade/Install: Restore or clean up the temporary plugin or theme backup on shutdown.
This allows these actions to run ''after'' the main process, without affecting the update. Actions running on `shutdown` are immune to PHP timeouts, so in case the failure was due to a PHP timeout, we'll still be able to properly restore the previous version.

Follow-up to [51815], [51898], [51899].

Props aristath, peterwilsoncc.
See #54166.
Built from https://develop.svn.wordpress.org/trunk@51902


git-svn-id: http://core.svn.wordpress.org/trunk@51495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-11 15:09:05 +00:00
Sergey Biryukov
d5887aeec3 Upgrade/Install: Introduce a move_dir() function.
This replaces the `copy_dir()` usage in `WP_Upgrader::install_package()` and aims to avoid PHP timeout issues when installing or updating large plugins on slower systems like Vagrant or the WP Docker test environment.

The new function attempts a native PHP `rename()` function first and falls back to the previous `copy_dir()`.

Follow-up to [51815], [51898].

Props afragen, aristath, peterwilsoncc, galbaras, noisysocks, pbiron.
Fixes #54166. See #51857.
Built from https://develop.svn.wordpress.org/trunk@51899


git-svn-id: http://core.svn.wordpress.org/trunk@51492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-09 03:38:57 +00:00
Sergey Biryukov
0f2d2264b5 Site Health: Use an integer value as a fallback in the available disk space check.
This avoids a few type problems further in the code: boolean divided by a number, or passing `false` to `size_format()` which is documented to accept integers or strings only.

Follow-up to [51815].

Props TobiasBg.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@51898


git-svn-id: http://core.svn.wordpress.org/trunk@51491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-09 02:50:56 +00:00
Sergey Biryukov
c477dcda88 Taxonomy: Populate the WP_Terms_List_Table::$items property in ::prepare_items().
This allows the parent `WP_List_Table::has_items()` method to work as expected, and the override in the child class can now be removed. It also makes the class more consistent with other list table classes.

As a result of this change, the "Bulk actions" dropdown is no longer unnecessarily displayed if there are no terms.

Follow-up to [15491], [17025], [17026].

Props mattoakley, swissspidy, audrasjb, SergeyBiryukov.
Fixes #54181.
Built from https://develop.svn.wordpress.org/trunk@51896


git-svn-id: http://core.svn.wordpress.org/trunk@51489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-08 00:38:00 +00:00
hellofromTonya
84e3375cd7 Permalinks: Move the Nginx documentation link to help sidebar in wp-admin/options-permalink.php.
The "Documentation on Nginx configuration." link is out of place being below the "Save Changes" button on the Settings > Permalinks UI.

This commit relocates the link to join the other support related content links in the help tab's "For more information:" right sidebar area.

Follow-up to [34691], [45674].

Props audrasjb, hellofromTonya, johnjamesjacoby, mukesh27, peterwilsoncc, timlappe.
Fixes #39258.
Built from https://develop.svn.wordpress.org/trunk@51892


git-svn-id: http://core.svn.wordpress.org/trunk@51485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 23:11:06 +00:00
Sergey Biryukov
a1c50512d7 Accessibility: Privacy: Use red color for action buttons on the Erase Personal Data screen:
* "Erase Personal Data" button in the Next Steps column.
* "Force Erase Personal Data" row action.

This highlights the destructive nature of those buttons to avoid an accidental erasure, and is consistent with other similar UI elements in the admin, e.g. various "Delete", "Spam", or "Trash" buttons.

Props arena, sabernhardt, carike, azaozz, joedolson, audrasjb, SergeyBiryukov.
Fixes #49603.
Built from https://develop.svn.wordpress.org/trunk@51891


git-svn-id: http://core.svn.wordpress.org/trunk@51484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 20:32:05 +00:00
hellofromTonya
3c16cc2cfb Administration: Allow plugin action links row to wrap.
When there are several action links or the text for these links is long, the plugin name column's width extends causing the other columns to shrink in width. This case is a less than desirable user experience.

The plugin name's column has `white-space: nowrap` (on larger screens). This commit changes the `white-space` to `normal`, allowing the plugin action links row to wrap into more than one line.

Follow-up to [41695].

Props ankit-k-gupta, nekojonez, sabernhardt, sergeybiryukov.
Fixes #53275.
Built from https://develop.svn.wordpress.org/trunk@51887


git-svn-id: http://core.svn.wordpress.org/trunk@51480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 15:07:05 +00:00
hellofromTonya
b3c6ad3a6b Administration: Enable first and last page buttons in WP_List_Table::pagination().
Previously the first and last page pagination buttons were disabled when on their next or previous page respectively. This commit removes that unnecessary logic to keep these buttons enabled and avoid confusion in the user's navigation workflow. 

New behavior:
- When on page 2, the go to first page `«` button is enabled
- When on the page before the last page, the go to last page `»` button is enabled

Follow-up to [32948], [47219].

Props wp_kc, ronakganatra, knutsp, sabernhardt, Hareesh Pillai, audrasjb, hellofromTonya.
Fixes #42763.
Built from https://develop.svn.wordpress.org/trunk@51880


git-svn-id: http://core.svn.wordpress.org/trunk@51473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-01 18:39:58 +00:00
hellofromTonya
bc217668e2 App Passwords: Remove placeholder from the app password name input field.
In [49294, 49752], the `placeholder` attribute changed to `"WordPress App on My Phone"`. This change causes confusion as the field can be used in a variety of ways and is not limited to a phone.

Given a label exists for each field and clearly identifies its purpose, this commit removes the `placeholder` attribute from the `input` field.

Follow-up to [49109], [49294], [49752].

Props seedsca, audrasjb, joedolson, rehanali.
Fixes #54047.
Built from https://develop.svn.wordpress.org/trunk@51878


git-svn-id: http://core.svn.wordpress.org/trunk@51471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-01 13:49:00 +00:00
Sergey Biryukov
8c52bfe712 Coding Standards: Remove duplicate assignment from a ternary operator in WP_MS_Sites_List_Table::site_states().
Adjust similar code in `_post_states()` and `_media_states()` for consistency.

Follow-up to:
* [12897], [15491], [32755], [46153], [48424] for `WP_MS_Sites_List_Table::site_states()`.
* [17793], [47775], [49223] for `_media_states()`.
* [9153], [46309] for `_post_states()`.

Props joelcj91, audrasjb, desrosj.
Fixes #38296.
Built from https://develop.svn.wordpress.org/trunk@51873


git-svn-id: http://core.svn.wordpress.org/trunk@51466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-27 00:37:01 +00:00
whyisjake
f2d1e16f50 Posts, Post Types: Don't add a trailing number when there is a unique post parent.
WordPress tries to avoid an issue where slugs might match an existing slug of a page/post. 
If we are in a hierarchical post type, there will be a level, and we can leave it the same.

Props stormrockwell, SergeyBiryukov, terriann, tubys, jeremyfelt, Daschmi, MaximeCulea, knutsp, whyisjake.
Fixes #51147.
See also #44112 and #45260.

Built from https://develop.svn.wordpress.org/trunk@51855


git-svn-id: http://core.svn.wordpress.org/trunk@51454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 20:27:58 +00:00
Sergey Biryukov
052b00b0c4 Docs: Fix typo in the $clear_working parameter description in WP_Upgrader methods.
Follow-up to [30758], [51527].

Props zenithcity, aezazshekh, pbiron, mukesh27.
Fixes #54163.
Built from https://develop.svn.wordpress.org/trunk@51854


git-svn-id: http://core.svn.wordpress.org/trunk@51453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 14:23:01 +00:00
John Blackbourn
07f3c35467 General: Fix code quality issues which were identified by static analysis.
This fixes minor issues that could cause PHP notices under the right conditions, and fixes some general incorrectness.

Props jrf, hellofromTonya for review

See #52217

Built from https://develop.svn.wordpress.org/trunk@51850


git-svn-id: http://core.svn.wordpress.org/trunk@51449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 21:01:00 +00:00
John Blackbourn
ae9eae8f64 Docs: Document some more common names for dynamic hooks and standardise the phrasing used.
Fixes #53581

Built from https://develop.svn.wordpress.org/trunk@51837


git-svn-id: http://core.svn.wordpress.org/trunk@51444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-21 18:21:00 +00:00
johnjamesjacoby
79c59fa78c Docs: Remove deprecated option groups from register_setting() and add_option_update_handler().
* `misc` was deprecated in version 3.0.0.
* `privacy` was deprecated in version 3.5.0.

See #53399.


Built from https://develop.svn.wordpress.org/trunk@51827


git-svn-id: http://core.svn.wordpress.org/trunk@51434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 16:20:00 +00:00
Sergey Biryukov
dcca93232b Upgrade/Install: Create a temporary backup of plugins and themes before updating.
This aims to make the update process more reliable and ensures that if a plugin or theme update fails, the previous version can be safely restored.

* When updating a plugin or theme, the old version is moved to a temporary backup directory:
 * `wp-content/upgrade/temp-backup/plugins/[plugin-slug]` for plugins
 * `wp-content/upgrade/temp-backup/themes/[theme-slug]` for themes.

* If the update fails, then the temporary backup kept in the `upgrade/temp-backup` directory is restored to its original location.
* If the update succeeds, the temporary backup is deleted.

To further help troubleshoot plugin and theme updates, two new checks were added to the Site Health screen:
* A check to make sure that the `temp-backup` directory is writable.
* A check that there is enough disk space available to safely perform updates.

To avoid confusion: The `temp-backup` directory will NOT be used to "roll back" a plugin to a previous version after a completed update. This directory will simply contain a transient backup of the previous version of a plugin or theme being updated, and as soon as the update process finishes, the directory will be empty.

Props aristath, afragen, pbiron, dd32, poena, TimothyBlynJacobs, audrasjb, mikeschroder, a2hosting, hellofromTonya, KZeni, galbaras, richards1052, Boniu91, mai21, francina, SergeyBiryukov.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@51815


git-svn-id: http://core.svn.wordpress.org/trunk@51422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 18:41:00 +00:00
Sergey Biryukov
65ff35bb75 Site Health: Move the Imagick entry higher in the list of recommended PHP extensions.
This better matches its position in the [https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions Hosting Team's handbook] recommendations.

Follow-up to [44986], [46268], [51804].

See #52654.
Built from https://develop.svn.wordpress.org/trunk@51805


git-svn-id: http://core.svn.wordpress.org/trunk@51412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-12 10:09:57 +00:00
Sergey Biryukov
e76b896881 Site Health: Add Intl to the list of recommended PHP extensions.
**Why is the PHP Intl extension important?**

WordPress is a global, international software, with support for a multitude of languages and with infinite combinations. Approximately half of the installations are in a language that is not the default (English), and this leads us to think about localization, transliteration, encoding conversions, calendar operations, collation… in short, everything you have with the different languages and formats that are around the planet. And this is what the [https://www.php.net/manual/en/intro.intl.php PHP Intl extension] provides.

**What do we as the WordPress Community gain from this extension?**

This extension provides a lot of functions for better internationalization support, including but not limited to:
* [https://www.php.net/manual/en/collator.compare.php collator_compare()] to compare Unicode text strings
* [https://www.php.net/manual/en/numberformatter.format.php numfmt_format()] to format a number according to the selected locale
* the [https://www.php.net/manual/en/normalizer.normalize.php normalization] of characters
* the [https://www.php.net/manual/en/messageformatter.formatmessage.php formatting] of messages
* getting the [https://www.php.net/manual/en/intlcalendar.getfirstdayofweek.php first day of the week] according to the locale.


In addition to functionality and ease of development, the extension can also help improve security, with classes like `Spoofchecker` that can tell you [https://www.php.net/manual/en/spoofchecker.areconfusable.php if ‘google.com’, ‘goog1e.com’ can confuse the user], or functions related to Internet domains, both to convert an [https://www.php.net/manual/en/function.idn-to-ascii.php IDN domain to text] and [https://www.php.net/manual/en/function.idn-to-utf8.php text to IDN].

**Hosting Team Recommendation**

Taking into account that WordPress continues to grow, the Hosting Team has considered a good recommendation, but not an obligation, for all hosts that work with WordPress to offer this extension, by default, to all users.

Reference: [https://make.wordpress.org/hosting/2021/05/20/why-hosters-should-install-the-php-intl-extension/ Why hosters should install the PHP-intl extension].

Follow-up to [44986], [46268].

Props zodiac1978, JavierCasares, jrf, Clorith, josklever.
Fixes #52654.
Built from https://develop.svn.wordpress.org/trunk@51804


git-svn-id: http://core.svn.wordpress.org/trunk@51411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-11 18:20:59 +00:00
Sergey Biryukov
018ad6098c Accessibility: Administration: Improve aria-label on network admin Themes screen.
This ensures that the beginning of the label matches the visible link text.

Add a similar label for the plugin URI link on the Plugins screen when the plugin is outside of the directory.

Follow-up to [28673], [28706], [35924].

Props sabernhardt, zeo, audrasjb.
Fixes #24442.
Built from https://develop.svn.wordpress.org/trunk@51795


git-svn-id: http://core.svn.wordpress.org/trunk@51402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 14:49:00 +00:00
hellofromTonya
07139653b9 Widgets: Revert [51705].
While the new name is much better, it doesn't fully tell what will happen when invoked nor does it fully solve the root problems. 

Why? The function is doing too much. And naming is hard.

Props azaozz, desrosj, andraganescu, zieladam, hellofromTonya.
See #53811.
Built from https://develop.svn.wordpress.org/trunk@51791


git-svn-id: http://core.svn.wordpress.org/trunk@51398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 21:40:57 +00:00
hellofromTonya
5887edee86 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Upgrader_Skin::error().
In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [11005], [25806], [32655], [38199].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51782


git-svn-id: http://core.svn.wordpress.org/trunk@51389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:59:56 +00:00
hellofromTonya
03331f52ff Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in WP_Upgrader_Skin::feedback().
In the parent class, renames the parameter `$string` to `$feedback`.
Why? `string` is a PHP reserved keyword.

In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [11005], [25228], [30680], [32655], [38199], [49596].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51781


git-svn-id: http://core.svn.wordpress.org/trunk@51388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:48:56 +00:00
hellofromTonya
a395d4c50e Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in Walker::end_el().
In the parent class, renames the parameter `$object` to `$data_object`.
Why? `object` is a PHP reserved keyword. The parameter name is selected for consistency with `Walker::start_el()`.

In each child class: renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [7737], [8900], [8970], [14248], [16100], [25642], [25644], [37051], [37056].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51780


git-svn-id: http://core.svn.wordpress.org/trunk@51387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:03:55 +00:00
hellofromTonya
7abc752329 Code Modernization: Fix last parameter name mismatches for parent/child classes in Walker::start_el().
The parent class uses `$current_object_id` while most of the child classes use `$id`. As the parent class' is more descriptive, renaming the last parameter in each of child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

- In cases where the original parameter name was too generic or misleading, renamed (when reassigning) to a more descriptive name for use within the method.

Follow-up to [7737], [8900], [8970], [14248], [15077], [16100], [25642], [25644], [37051], [37054], [37056], [46271], [47189], [51739].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51779


git-svn-id: http://core.svn.wordpress.org/trunk@51386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 12:39:59 +00:00
Andrew Ozz
0fcde6de17 Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.
Props desrosj, davidbinda, azaozz.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51768


git-svn-id: http://core.svn.wordpress.org/trunk@51375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 23:29:58 +00:00
hellofromTonya
1105ddf965 Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in Walker::start_el().
In the parent class, renames the parameter `$object` to `$data_object`.

Why? `object` is a PHP reserved keyword.

In each child class: renames the corresponding parameter to match the parent's method signature.

Why? 

PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

- in cases where the original parameter name was too generic, renamed (when reassigning) to a more descriptive name for use within the method.

Follow-up to [7737], [8900], [8970], [14248], [15077], [16100], [25642], [25644], [37051], [37054], [37056], [46271], [47189].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51739


git-svn-id: http://core.svn.wordpress.org/trunk@51347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 15:36:59 +00:00
hellofromTonya
aebe05f6f4 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::handle_row_actions().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [32644], [32664], [32798], [38489], [49183], [49197].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51737


git-svn-id: http://core.svn.wordpress.org/trunk@51345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 19:24:53 +00:00
hellofromTonya
7d6a70107a Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::column_cb().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [15632], [30679], [31210], [32740], [32753], [32754], [32755], [32756], [32757].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51735


git-svn-id: http://core.svn.wordpress.org/trunk@51343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 18:19:56 +00:00
hellofromTonya
213ce0c7ea Code Modernization: Improve @since message in WP_List_Table::column_default().
Improves the `@since` message to more clearly specify the reason for this change" for PHP 8 named parameter support.

Follow-up to [51728].

Props jrf.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51734


git-svn-id: http://core.svn.wordpress.org/trunk@51342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 16:57:58 +00:00
Sergey Biryukov
5a7eca9a0e Docs: Correct documentation for the in_plugin_update_message-{$file} filter.
The `$response` parameter is an object, not an array.

This is a minor inconsistency with the corresponding `in_theme_update_message-{$theme_key}` action for themes, where the `$response` parameter is an array.

For backward compatibility, it is safer not to change the parameter type at this point, but to make sure the documentation is correct.

Follow-up to [11193], [16141], [26540].

Props davidmosterd, audrasjb, SergeyBiryukov.
See #40006.
Built from https://develop.svn.wordpress.org/trunk@51733


git-svn-id: http://core.svn.wordpress.org/trunk@51341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 12:55:00 +00:00
Sergey Biryukov
de70e2c68b Docs: Correct the post_submitbox_minor_actions hook description.
The action fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons in the Publish meta box.

The previous description stated that the action fires before the post date/time setting, which was not quite correct, as there are also post status and visibility settings between the action and the date/time setting.

Follow-up to [34895].

Props bedas, audrasjb.
Fixes #54045.
Built from https://develop.svn.wordpress.org/trunk@51732


git-svn-id: http://core.svn.wordpress.org/trunk@51338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-06 13:36:01 +00:00
hellofromTonya
2c91899724 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::column_default().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [15632], [30679], [31210], [32740], [32753], [32754], [32755], [32756], [32757].

Props jrf, hellofromTonya, @sergeybiryukov, @azaozz, @desrosj, @johnbillion
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51728


git-svn-id: http://core.svn.wordpress.org/trunk@51334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-02 22:26:56 +00:00
ryelle
c11fbdc7ae Coding Standards: Apply coding standards on CSS.
Remove units when the value is zero. Combine redundant values in shorthand declarations.
This was generated with `stylelint --fix` and a custom config (see #53866).

Props ankitmaru, audrasjb, pbiron, ayeshrajans, hareesh-pillai, netweb, mukesh27.
Fixes #53866.


Built from https://develop.svn.wordpress.org/trunk@51727


git-svn-id: http://core.svn.wordpress.org/trunk@51333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-02 22:18:00 +00:00
noisysocks
9697e5a63b Customize: Add wp-embed-responsive class to body if using widgets block editor
Appends the wp-embed-responsive class to the body if the widgets block editor is
enabled. This fixes a bug preventing embeds (e.g. YouTube embeds) appearing in
the widgets block editor.

Fixes #53609.
Props walbo, kevin940726.

Built from https://develop.svn.wordpress.org/trunk@51716


git-svn-id: http://core.svn.wordpress.org/trunk@51322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 07:10:56 +00:00
Sergey Biryukov
049bbe8356 Site Health: Remove MySQL query cache size from the Site Health Info screen.
The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.

Reference: [https://dev.mysql.com/doc/refman/5.7/en/query-cache-configuration.html MySQL 5.7 Reference Manual: Query Cache Configuration].

Follow-up to [51522], [51523].

Props johnbillion, zodiac1978.
Fixes #53845.
Built from https://develop.svn.wordpress.org/trunk@51715


git-svn-id: http://core.svn.wordpress.org/trunk@51321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 07:01:56 +00:00
hellofromTonya
71977c215d Widgets: Rename and soft deprecate retrieve_widgets().
The original name `retrieve_widgets()` was unclear as it suggested it was a getter, i.e. getting the widgets. This function does more than get: finds orphaned widgets, assigns them to the inactive sidebar, and updates the database.

The new name is `sync_registered_widgets()` which better represents what happens when this function is invoked.

The original `retrieve_widgets()` function is soft deprecated to avoid unnecessary code churn downstream for developers that support more than the latest version of WordPress.

Follow-up to [18630].

Props zieladam, timothyblynjacobs, andraganescu, hellofromTonya.
See #53811.
Built from https://develop.svn.wordpress.org/trunk@51705


git-svn-id: http://core.svn.wordpress.org/trunk@51311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 19:58:58 +00:00
desrosj
e91f690333 Widgets: Show title and media select fields in Accessibility Mode.
This updates the Custom HTML and Media widgets to display the correct fields when adding or editing a widget when using accessibility mode through the Classic Widgets experience.

Follow up to [49973].

Props mark-k, sabernhardt, alexstine, circlecube, audrasjb.
Fixes #53641.
Built from https://develop.svn.wordpress.org/trunk@51701


git-svn-id: http://core.svn.wordpress.org/trunk@51307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 13:51:00 +00:00
Sergey Biryukov
892c8ecbdb Widgets: Pass correct context to get_block_categories() calls.
The `get_block_categories()` function expects either a `WP_Post` or a `WP_Block_Editor_Context` instance as the context argument, not a string.

Follow-up to [50996], [50997].

Props Enchiridion, pbearne, audrasjb.
Fixes #53757.
Built from https://develop.svn.wordpress.org/trunk@51700


git-svn-id: http://core.svn.wordpress.org/trunk@51306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 13:38:58 +00:00
Peter Wilson
34d8dd914c Menus: Save display locations for new menus.
Fixes a bug preventing the locations saving when creating a new menu. Introduced in [50938].

Props dlh, andraganescu, mukesh27, desrosj.
Fixes #53877.


Built from https://develop.svn.wordpress.org/trunk@51688


git-svn-id: http://core.svn.wordpress.org/trunk@51294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 04:12:57 +00:00
Sergey Biryukov
26a276db6f Filesystem API: Make sure to only call fread() on non-empty files in PclZip::privAddFile().
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.

This commit also amends the previous solution for similar issues elsewhere in the file to ensure consistent type for string values, instead of changing the type from `string` to `bool` when trying to read from an empty file.

Follow-up to [50355].

Props DavidAnderson, jrf, SergeyBiryukov.
Fixes #54036.
Built from https://develop.svn.wordpress.org/trunk@51686


git-svn-id: http://core.svn.wordpress.org/trunk@51292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-29 01:33:58 +00:00
John Blackbourn
80c7b3cdf3 Administration: Remove a misleading pointer cursor from list items in the admin menu.
This prevents unclickable areas within the menu from appearing clickable.

Props circlecube, kurudrive, ryelle, opurockey

Fixes #51551

Built from https://develop.svn.wordpress.org/trunk@51684


git-svn-id: http://core.svn.wordpress.org/trunk@51290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 13:45:56 +00:00
Sergey Biryukov
42c7a1fad5 Coding Standards: Fix WPCS issue in [51682].
This fixes a "Misleading line break before `'||'`; readers may interpret this as an expression boundary" error.

See #54030.
Built from https://develop.svn.wordpress.org/trunk@51683


git-svn-id: http://core.svn.wordpress.org/trunk@51289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 01:34:56 +00:00
Sergey Biryukov
79b0d3f3e8 Customize: Prevent collapsing expanded panel/section/control when Esc is pressed on a block editor instance.
This ensures that the current panel is not collapsed when hitting `Esc` with the focus on the widget block editor.

Follow-up to [37347], [39120].

Props gwwar, dlh.
Fixes #54030.
Built from https://develop.svn.wordpress.org/trunk@51682


git-svn-id: http://core.svn.wordpress.org/trunk@51288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 01:25:59 +00:00
Sergey Biryukov
0ae0fbedce Plugins: Display a message on Plugins list table if a plugin requires a higher version of PHP or WordPress.
Installation and activation of incompatible plugins was previously disallowed in [43436] and [44978], but if such a plugin was installed manually, there was nothing on the Plugins screen that would show its compatibility status.

Showing an appropriate notice with a documentation link makes the UI more consistent and improves user experience.

Follow-up to [43436], [44937], [44939], [44978], [45043], [45165], [45546], [47573], [47816], [47819], [48172], [48636], [48637], [48638], [48640], [48652], [48653], [48654], [48660].

Props TacoVerdo, SergeyBiryukov.
Fixes #53990.
Built from https://develop.svn.wordpress.org/trunk@51678


git-svn-id: http://core.svn.wordpress.org/trunk@51284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-27 15:43:57 +00:00
Mike Schroder
9aeacc728a Customizer: Respect prefers-reduced-motion media query in Customizer animations.
Disables Customizer animations when media query `prefers-reduced-motion: reduce` returns true.

Continues the effort to reduce motion within the WordPress admin panel when users have enabled this feature in their operating system or browser.

It has the additional effect of making the Block Editor's end-to-end tests run faster, as explored initially with a different approach in #53562.

See https://github.com/WordPress/gutenberg/issues/32024 for the related Gutenberg issue.

See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion for ways to enable this feature on various platforms.

Props kevin940726, isabel_brison, zieladam, youknowriad, desrosj, mamaduka, mikeschroder.
Previously [51389], [50028], [47813].
Fixes #53542.
Built from https://develop.svn.wordpress.org/trunk@51677


git-svn-id: http://core.svn.wordpress.org/trunk@51283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-27 09:36:57 +00:00
hellofromTonya
ab252fb910 Coding Standards: Fix indentation and remove ignore annotation in wp_privacy_send_personal_data_export_email().
Follow-up to [51129], [51410].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51662


git-svn-id: http://core.svn.wordpress.org/trunk@51268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 14:05:58 +00:00
hellofromTonya
2e9fe3c986 Coding Standards: Make ignore annotation more specific in WP_Site_Health_Auto_Updates::test_vcs_abspath().
Follow-up to [44986].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51661


git-svn-id: http://core.svn.wordpress.org/trunk@51267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:59:59 +00:00
hellofromTonya
a91fc400a0 Coding Standards: Remove redundant ignore annotation in populate_options().
Follow-up to [43627], [43628].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51660


git-svn-id: http://core.svn.wordpress.org/trunk@51266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:50:59 +00:00
hellofromTonya
c7d3e267b8 Coding Standards: Use static closures when not using $this.
When a closure does not use `$this`, it can be made `static` for improved performance.

Static closures are supported in PHP since PHP 5.4. ​

Props jrf, hellofromTonya, swissspidy, SergeyBiryukov.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51657


git-svn-id: http://core.svn.wordpress.org/trunk@51263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 12:59:02 +00:00
Sergey Biryukov
622985b69c Docs: Add missing @since tag for the $check_signatures parameter of WP_Upgrader::run().
This matches the `WP_Upgrader::download_package()` documentation more closely.

Follow-up to [44954], [45262].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51655


git-svn-id: http://core.svn.wordpress.org/trunk@51261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-25 14:39:59 +00:00
Sergey Biryukov
d529999e5b Docs: Clarify a comment in WP_Upgrader::run().
This matches the `WP_Upgrader::download_package()` documentation more closely.

Follow-up to [11005], [30758], [33685].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51654


git-svn-id: http://core.svn.wordpress.org/trunk@51260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-24 23:10:06 +00:00
Andrew Ozz
774c8047c5 Editor: Replace the remaining references to wp.editor with wp.oldEditor.
Props zieladam.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51649


git-svn-id: http://core.svn.wordpress.org/trunk@51255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-21 00:20:00 +00:00
ryelle
899e4635de Privacy: Add space below page selector.
Sometimes the submit button wraps to a new line, either because the button label translation is long, or there are long page names. When it wraps, there should be space between the select dropdown and the button.

Props audrasjb, mukesh27, guillaumeturpin.
Fixes #53782.


Built from https://develop.svn.wordpress.org/trunk@51645


git-svn-id: http://core.svn.wordpress.org/trunk@51251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 20:58:57 +00:00
Sergey Biryukov
ccbd16fef1 Media: Check the return type of _get_cron_array() in WP_Media_List_Table::prepare_items().
The following warnings could, in very select circumstances, be shown:
{{{
// PHP 8.0 and higher:
Warning: foreach() argument must be of type array|object, bool given

// PHP 5.6 – 7.4
Warning: Invalid argument supplied for foreach()
}}}

In `WP_Media_List_Table::prepare_items()`, the cron info array is retrieved via a call to `_get_cron_array()`, but as the documentation (correctly) states, the return type of that function is `array|false`, where `false` is returned for a virgin site, with no cron jobs scheduled yet.

However, no type check is done on the return value, and the method just blindly continues by using it in a `foreach`.

Fixed by adding validation for the returned value from `_get_cron_array()` and only running the `foreach` when the returned value is an array.

Reference: [https://developer.wordpress.org/reference/functions/_get_cron_array/ WordPress Developer Resources: _get_cron_array()]

Follow-up to [48417].

Props jrf, hellofromTonya, mukesh27.
Fixes #53949.
Built from https://develop.svn.wordpress.org/trunk@51638


git-svn-id: http://core.svn.wordpress.org/trunk@51244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 12:44:57 +00:00
Peter Wilson
cda7c787e8 Customize: Hide native control on background position field.
Hide the browser's native radio button on the custom background position selector in the Customizer and the legacy background screen. This fixes an issue causing both to display.

Props mukesh27, ravipatel, sabernhardt, walbo.
Fixes #53803.

Built from https://develop.svn.wordpress.org/trunk@51637


git-svn-id: http://core.svn.wordpress.org/trunk@51243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 02:07:56 +00:00
Sergey Biryukov
1ee5e68a94 Code Modernization: Check the return type of parse_url() on Plugin/Theme Editor screens.
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

While it is probably unlikely that someone would have a direct link to the plugin/theme editor on their home page or even on someone else's homepage, it is entirely possible for the referrer URL to not have a "path" component.

In PHP 8.1, this would lead to a `basename(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `parse_url()` prevents that.

Follow-up to [51606], [51622], [51626].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51629


git-svn-id: http://core.svn.wordpress.org/trunk@51235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 21:56:58 +00:00
Sergey Biryukov
9f222b708a Code Modernization: Check the return type of parse_url() in download_url().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

This commit adds three unit tests for `download_url()`:

* The first test is "girl-scouting" to make sure that the code up to the point where the error is expected is tested.
* The second test exposed a PHP 8.1 `basename(): Passing null to parameter #1 ($path) of type string is deprecated` error due to the call to `parse_url()` returning `null` when the component requested does not exist in the passed URL.
* The output of the call to `parse_url()` stored in the `$url_path` variable is used in more places in the function logic. The third test exposes a second PHP 8.1 deprecation notice, this time for `substr(): Passing null to parameter #1 ($string) of type string is deprecated`.

This commit also removes duplicate `parse_url()` calls. Neither `$url` nor `$url_filename` are changed between when they are first received/defined and when they are re-used, so there is no need to repeat the function calls.

Follow-up to [51606], [51622].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51626


git-svn-id: http://core.svn.wordpress.org/trunk@51232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 00:16:01 +00:00
Sergey Biryukov
b4ea83c22f Upgrade/Install: Use consistent capitalization for "web host" in setup messages.
Follow-up to [8887], [13163].

Props bradparbs, sabernhardt, mukesh27.
Fixes #53926.
Built from https://develop.svn.wordpress.org/trunk@51610


git-svn-id: http://core.svn.wordpress.org/trunk@51221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-14 12:06:59 +00:00
Sergey Biryukov
e2a64f0cd2 Themes: Make sure the theme API response is not an error before operating on it in themes_api().
This fixes a potential bug and avoids PHP warnings when `themes_api( 'query_themes' )` is called and a successful API response is not received.

Follow-up to [42632].

Props pierlo.
Fixes #53913.
Built from https://develop.svn.wordpress.org/trunk@51601


git-svn-id: http://core.svn.wordpress.org/trunk@51212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 13:01:56 +00:00