44823 Commits

Author SHA1 Message Date
Jb Audras
194e456aa4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52225 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 22:54:34 +00:00
Sergey Biryukov
afc50ca20d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52224 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 22:15:26 +00:00
Tonya Mork
3442f776f3 Comments: Fix PHP Notice "trying to get property of non-object" in comments_open() and pings_open().
The post for the comments or pings is retrieved by `get_post()`. If the post exists, `get_post()` returns an instance of `WP_Post`; else, it returns `null`.

In both `comments_open()` and `pings_open()`, the returned value from `get_post()` is used without checking if the object returned, if the post exists. When the post does not exist, the following notices occur:

{{{
PHP Notice:  Trying to get property 'comment_status' of non-object in .../src/wp-includes/comment-template.php on line 1244
}}}

and

{{{
PHP Notice:  Trying to get property 'pings_open' of non-object in ../src/wp-includes/comment-template.php on line 1274
}}}

This commit fixes these notices by checking if the post has a non-falsey value before using it as an object to set the `$open` state. As the return from `get_post()` will only be an object or `null`, the truthy check is appropriate and slightly more performant.

Tests added to validate the fix.

Follow-up to [1964], [40666].

Props dd32, audrasjb, costdev, hellofromTonya, sergeybiryukov.
Fixes #54159.

git-svn-id: https://develop.svn.wordpress.org/trunk@52223 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 20:22:43 +00:00
Jeff Ong
c99da727d9 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs several changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], and [52164]. It includes improvements to the home page template, adding a filter for block patterns, pre-loading the web font, improvements and bug fixes to block patterns, and more. For a full list of changes, visit e4f69d0b7e...25d74deaa5.

Props jeffpaul, richtabor, netweb, luminuu, melchoyce, beafealho, clucasrowlands, desrosj, flixos90, joen, otto42, saju4wordpress, westonruter, kjellr, poena.
See #54318.


git-svn-id: https://develop.svn.wordpress.org/trunk@52222 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 20:12:44 +00:00
Jonathan Desrosiers
2a04054c0f Bundled Themes: Update the “Tested up to” header to 5.9.
This updates the “Tested up to” header in the `readme.txt` file for all bundled theme.

This also adds the “Tested up to” header to the `style.css` file for older default themes (Twenty Twenty and earlier). Previously, this header was only recommended, so it was not included. It is now required, per the theme handbook: https://make.wordpress.org/themes/handbook/review/required/#9-files.

Props kafleg, mukesh27, ravipatel.
Fixes #53797.

git-svn-id: https://develop.svn.wordpress.org/trunk@52221 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 19:32:29 +00:00
Jonathan Desrosiers
4976a2d626 Build/Test Tools: Add the ruleset file to the cache key for PHPCS and PHP compatibility scans.
This ensures that the cache is busted properly when the ruleset is adjusted but the `composer.json` file is not.

See #54425.

git-svn-id: https://develop.svn.wordpress.org/trunk@52220 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 19:21:36 +00:00
desrosj
a478079de9 Docs: Improve the documentation for registering block patterns and block pattern categories.
This expands the `@param` tag for the property argument available for the `register()` method in `WP_Block_Patterns_Registry` and `WP_Block_Pattern_Cattegories_Registry`.

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52219 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 19:04:01 +00:00
Tonya Mork
7ab2a96856 WPDB: Call wp_load_translations_early() in wpdb::query() and wpdb::process_fields().
For consistency and simplification, replaces the `function_exists( '__' )` checks with `wp_load_translations_early()` to make sure i18n functions are available. This change removes the extra code introduced in [52176] for using non-translated error messages when `__()` is not available.

Improves the plural versions of the error messages.

For performance, when there are more than one problem field, uses `reset()` to populate the field in the error message.

Follow-up to [52176], [52195].

Props sergeybiryukov, hellofromTonya.
Fixes #32315.

git-svn-id: https://develop.svn.wordpress.org/trunk@52218 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 18:58:14 +00:00
Jb Audras
36463dfee8 Twenty Twenty-One: Prevent notice thrown in twenty_twenty_one_get_attachment_image_attributes().
Calling `twenty_twenty_one_get_attachment_image_attributes()` was causing an `Undefined index: width|height` notice to be thrown when the result from `wp_get_attachment_metadata()` does not set any value to `$meta`. This change adds an `isset()` check to prevent it.

Props wetah, hasanuzzamanshamim.
Fixes #54464.


git-svn-id: https://develop.svn.wordpress.org/trunk@52217 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 17:54:43 +00:00
Jonathan Desrosiers
8a0db56771 Script Loader: Document path as an accepted value for $key in wp_style_add_data().
Follow up to [50836].

Props tmatsuur.
Fixes #53792.

git-svn-id: https://develop.svn.wordpress.org/trunk@52216 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 15:12:25 +00:00
Jonathan Desrosiers
d87196b560 Docs: Remove instances of the “eg.” abbreviation in favor of “example” or “for example”.
See #53330.

git-svn-id: https://develop.svn.wordpress.org/trunk@52215 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 14:42:04 +00:00
Jonathan Desrosiers
2e246c302b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52214 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 14:18:17 +00:00
Jb Audras
48fe42e9d2 Twenty Twenty-One: Check if anchor exists before triggering in-page navigation.
This prevents JavaScript errors when using hash in URLs without matching them to any existing anchor in the page.

Props rixeo, sabernhardt, pbearne.
Fixes #53619.


git-svn-id: https://develop.svn.wordpress.org/trunk@52213 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 13:01:23 +00:00
Jb Audras
c08e51cc88 Docs: Add missing parameters in in_plugin_update_message-{$file} filter.
Follow-up to [51733].

Props costdev, audrasjb, SergeyBiryukov.
Fixes #40006.


git-svn-id: https://develop.svn.wordpress.org/trunk@52212 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 23:17:52 +00:00
Jonathan Desrosiers
022287380f Twenty Twenty-One: Correct description of Dark Mode in the Customizer.
The Dark Mode toggle can appear in both bottom corners. This removes “right” from the description to be accurate for both RTL and LTR languages.

Props musabshakeel, dilipbheda, sabernhardt.
Fixes #53892.

git-svn-id: https://develop.svn.wordpress.org/trunk@52211 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 20:41:21 +00:00
Jonathan Desrosiers
e7f1bda4aa Twenty Sixteen: Correctly align columns within table blocks as configured in the editor.
Previously, all columns were forced to be aligned left, and aligned right for RTL languages.

Props robertghetau, umesh84, sabernhardt.
Fixes 54317.

git-svn-id: https://develop.svn.wordpress.org/trunk@52210 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 20:20:37 +00:00
David Baumwald
321dbd8efc Toolbar: Refine "Edit site" link.php.
The 'Edit site' link was added to core in [52158], but did not include an icon and was hidden for smaller screen sizes.  This change adds the "Appearance" icon to the link and hides the link text when necessary on smaller screen sizes.

Props sabernhardt, desrosj, shaunandrews.
Fixes #54441.

git-svn-id: https://develop.svn.wordpress.org/trunk@52209 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 16:46:56 +00:00
Jb Audras
5effc56351 Docs: Add missing null allowed type for the $id parameter of wp_set_current_user().
Props andy-schmidt.
See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52208 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 16:02:41 +00:00
Jb Audras
c25c175b47 Posts, Post Types: Multisite: Decrement post_count option value when a post is deleted.
Previously, the `post_count` option value was not decremented when a post was deleted.

This change moves the `_update_posts_count_on_delete` action from `delete_post` hook to `after_delete_post` to ensure the deletion is taken into account.

Props henry.wright, pbearne, audrasjb.
Fixes #53443.


git-svn-id: https://develop.svn.wordpress.org/trunk@52207 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 15:10:18 +00:00
Sergey Biryukov
47d8c7313e Database: Check if the $args[0] value exists in wpdb::prepare() before accessing it.
This avoids an `Undefined array key 0` PHP warning if no values are passed to the method besides the query string.

Follow-up to [41470].

Props mjaschen.
Fixes #54453.

git-svn-id: https://develop.svn.wordpress.org/trunk@52206 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 14:35:22 +00:00
John Blackbourn
041171cf83 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


git-svn-id: https://develop.svn.wordpress.org/trunk@52205 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 13:55:36 +00:00
John Blackbourn
9932b46595 Docs: Various corrections and improvements relating to types used in inline documentation.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52204 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 13:48:43 +00:00
Jb Audras
fb23461742 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52203 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 09:23:51 +00:00
Jb Audras
d6f3d408d8 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52202 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-18 00:19:32 +00:00
Jb Audras
206f8b1d95 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52201 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 23:06:06 +00:00
Joe Dolson
59311a53d2 Comments: Change new comment required text class.
Change the new class on comment required text from `comment-required-message` to `required-field-message` for better future-compatibility, enabling better reuse.

Props sabernhardt.
Fixes #16206.


git-svn-id: https://develop.svn.wordpress.org/trunk@52200 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 18:36:53 +00:00
Tonya Mork
902fd83cf4 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. 

git-svn-id: https://develop.svn.wordpress.org/trunk@52199 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 17:43:41 +00:00
Joe Dolson
11e1a295b6 Toolbar: Prevent adminbar from hiding in-page anchors.
Use scroll-padding-top to offset scroll position on in-page anchors when adminbar is active. Also adjusts existing scroll padding for core themes that implement it.

Props afercia, kingkero, audrasjb, dufresnesteven, thimalw, sabernhardt, costdev.
Fixes #46371.


git-svn-id: https://develop.svn.wordpress.org/trunk@52198 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 17:18:09 +00:00
Jb Audras
5036d60706 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52197 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 16:22:19 +00:00
Joe Dolson
8cc2cd4a7d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52196 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 15:54:40 +00:00
Sergey Biryukov
d772a0407e WPDB: Call wp_load_translations_early() in wpdb::_real_escape().
This follows the pattern used in other `wpdb` methods to make sure the i18n functions are available.

Follow-up to [29840].

Props nacin, johnbillion.
See #32315.

git-svn-id: https://develop.svn.wordpress.org/trunk@52195 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 04:03:25 +00:00
Peter Wilson
aec78f5a16 Posts, Post Types: Use global post as the default for wp_get_post_parent_id().
Convert the `$post` parameter of `wp_get_post_parent_id()` to optional, defaulting to the current global post object when called within the loop.

Props danielpost, davidbaumwald, SergeyBiryukov, birgire, audrasjb, hellofromTonya, TimothyBlynJacobs.
Fixes #48358.



git-svn-id: https://develop.svn.wordpress.org/trunk@52194 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 03:23:40 +00:00
Jb Audras
6679a0614d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52193 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-17 00:12:35 +00:00
Sergey Biryukov
c1089ebc68 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52192 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 22:18:32 +00:00
Jb Audras
6192591757 Twenty Twenty-One: Remove RSS feed widget icon link.
Use the `rss_widget_feed_link` filter to disable the output of the icon on RSS feed widgets in Twenty Twenty-One. Improves accessibility by preventing invisible links.

Props sabernhardt, poena.
Fixes #52880.


git-svn-id: https://develop.svn.wordpress.org/trunk@52191 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 21:46:24 +00:00
Tonya Mork
3a03cdd776 Media: Add support for v1 and v2 gallery block in get_post_galleries().
The `get_post_galleries()` function only handled galleries from the `[gallery]` shortcode. It did not process gallery blocks.

Introducing v1 and v2 gallery block support in `get_post_galleries()` including support for innerblock nesting.

There are no changes to how the function is called. It detects if the post content has one or more gallery blocks. If detected, it parses the blocks and then processes to add each gallery block's HTML to the array of galleries before being passed through the filter and returned.

Includes integration tests.

Follow-up to [24682], [43309], [48262], [52042].

Props glendaviesnz, costdev, antpb, audrasjb, birgire, celloexpressions, desrosj, hellofromTonya, jeffpaul, lynk, pento, ramonopoly, russhylov, takahashi_fumiki, tellyworth.
Fixes #43826.

git-svn-id: https://develop.svn.wordpress.org/trunk@52190 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 21:23:12 +00:00
Adam Silverstein
530a3b0376 Media: improve error message for failed image uploads.
Clarify error language and change the maximum suggested size to match the large image threshold.

Props zodiac1978, SergeyBiryukov, antpb, webcommsat, hellofromTonya. 
Fixes 53985.



git-svn-id: https://develop.svn.wordpress.org/trunk@52189 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 19:59:11 +00:00
Tonya Mork
dac57bbf50 Formatting: Add additional support for single and nestable tags in force_balance_tags().
Adds `track` and `wbr` support for single tags.

Adds `article`, `aside`, `details`, `figure`, and `section` for nestable tags.

Updates tests.

Follow-up to [5805], [21828], [45929].

Props glendaviesnz, costdev, talldanwp, ramonopoly, sergeybiryukov.
Fixes #50225.

git-svn-id: https://develop.svn.wordpress.org/trunk@52188 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 19:40:36 +00:00
Tonya Mork
5d5c9bf6a7 HTTP API: Remove empty ? when only anchor remains in add_query_arg().
If after processing through `add_query_arg()` a `?#` remains, this commit removes the unnecessary and unused `?` character as there are no query args in the URL.

Includes tests.

Follow-up to [1823], [5193], [5999], [6005].

Props benjaminanakenam, sabernhardt, costdev, hellofromTonya.
Fixes #44499.

git-svn-id: https://develop.svn.wordpress.org/trunk@52187 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 18:48:47 +00:00
Jonny Harris
3c4d1d8c44 REST API: Make the templates controller follow core REST patterns.
The templates controller now respects the `_fields` parameter and filters the response accordingly. The schema has been updated to include all the fields returned. The `content.block_version` field has been added. The controller now returns WP_Error objects for improved error handling.

Add new unit tests.

Props TimothyBlynJacobs, hellofromtonya, zieladam.
Fixes #54422.


git-svn-id: https://develop.svn.wordpress.org/trunk@52186 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 18:04:49 +00:00
Kelly Choyce-Dwan
076d207fc1 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52185 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 17:16:07 +00:00
Jonny Harris
f4e75ee8b7 REST API: Remove experimental block menu item types.
The menu items REST API controller was added in [52079]. This included functionality to add a "block" menu item type. This functionality is experimental and not currently used in WordPress core, so should be removed. 

Props noisysocks.
See #40878.



git-svn-id: https://develop.svn.wordpress.org/trunk@52184 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 17:07:43 +00:00
Jonathan Desrosiers
e411a1536a Build/Test Tools: Update all 3rd party GitHub actions to the latest versions.
See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52183 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 16:08:03 +00:00
Jonathan Desrosiers
a53e6bb7e0 Twenty Nineteen: Apply coding standards fix from running composer format.
Follow up to [52149].

See #54392.

git-svn-id: https://develop.svn.wordpress.org/trunk@52182 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 15:01:37 +00:00
Jonathan Desrosiers
a125f5e87f Themes: Check both parent and child themes for a theme.json file.
This updates `WP_Theme_JSON_Resolver::theme_has_support()` to properly check for a `theme.json` file in both parent and child themes when determining whether a theme supports block templates.

Follow up to [52077].

Props Mamaduka.
Fixes #54401.

git-svn-id: https://develop.svn.wordpress.org/trunk@52181 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 14:56:42 +00:00
Tonya Mork
a8485376d2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52180 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 14:55:04 +00:00
Jonathan Desrosiers
ba620225c5 Build/Test Tools: Cache the results of PHP_CodeSniffer across workflow runs.
When the `PHP_CodeSniffer` runs, it produces a cache file. When a cache file is present, only changed files are rescanned, making subsequent scans significantly faster.

This adds the needed steps to the corresponding GitHub Actions workflows to cache these files across runs. The cache keys include the date of the previous Monday to ensure that the cache is flushed at least weekly.

Since GitHub Action caches cannot be updated once created, the scans will take slightly longer as the week progresses and more PHP files are updated. The date within the cache key can be updated to purge twice weekly if the scan time starts to approach the current scan times.

This change also introduces a `.cache` directory for all caching files related to build/test tools.

Props johnbillion, jrf.
Fixes #49783.

git-svn-id: https://develop.svn.wordpress.org/trunk@52179 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 14:17:26 +00:00
Tonya Mork
c3222105d8 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52178 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 04:43:49 +00:00
Tonya Mork
8e0e534d90 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52177 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 03:16:40 +00:00
Tonya Mork
648eb03768 WPDB: Capture error in wpdb::$last_error when insert fails instead of silently failing for invalid data or value too long.
Instead of silently failing when attempting to insert a value into a field, this commit saves the error in the `wpdb::$last_error` property.

Sets `last_error` with an error message if:
* `wpdb::query()` fails for invalid data
* `wpdb::process_fields()` fails to process the value(s) for the field(s) where the value could be too long or contain invalid data

Sets `last_query` if `wpdb::query()` fails for invalid data.

If `__()` is not available, uses non-translated error message to ensure the error is captured.

There is no change to wpdb aborting when an error occurs.

Adds tests.

Props dlt101, mnelson4, dd32, pento, hellofromTonya, davidbaumwald, sergeybiryukov, johnbillion, swissspidy, datainterlock, anandau14, anthonyeden, asif2bd, audrasjb, chaion07, dpegasusm, fpcsjames, galbaras, jdgrimes, justindocanto, kwisatz, liammitchell, lucasw89, lukecarbis, nettsite, nlpro, procodewp, psufan, richardfoley, skunkbad, travisnorthcutt, woodyhayday, zoiec.
Fixes #37267.

git-svn-id: https://develop.svn.wordpress.org/trunk@52176 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 02:57:53 +00:00