Commit Graph

17953 Commits

Author SHA1 Message Date
Sergey Biryukov
8f994d84de Media: Add / character to <img> tag in wp_print_media_templates().
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51473], [51541].

Props shital-patel, akabarikalpesh.
Fixes #53870.
Built from https://develop.svn.wordpress.org/trunk@51542


git-svn-id: http://core.svn.wordpress.org/trunk@51153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 14:25:58 +00:00
Sergey Biryukov
0be77d4ebf Bundled Themes: Add / character to <img> tags.
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51473].

Props shital-patel, akabarikalpesh.
See #53870.
Built from https://develop.svn.wordpress.org/trunk@51541


git-svn-id: http://core.svn.wordpress.org/trunk@51152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 14:24:02 +00:00
Peter Wilson
67119713fc Editor: Prevent block-editor JavaScript loading in other editors.
Add a check to `wp_add_iframed_editor_assets_html()` confirming the edit post screen is using the block-editor before including block-editor specific JavaScript. For the classic and other editors the function returns early without any output.

Props swissspidy, desrosj.
Fixes #53696.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 05:10:56 +00:00
Peter Wilson
7829821c62 Menus: Hide bulk-select on new menu page.
Prevent the bulk-select option from displaying when adding a new menu. This also prevents the option from displaying when an administrator first visits the menu page and no menus are set.

Props dlh, sabernhardt.
Fixes #53654.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 05:00:59 +00:00
jorgefilipecosta
eff1c81de6 Block Editor: Add missing border setting on button block.
This commit fixes a regression on WordPress 5.8 that made the border radius setting on the buttons block disappear.

Props Mamaduka, daisyo, priethor, desrosj, mikeschroder.
Fixes #53702.
Built from https://develop.svn.wordpress.org/trunk@51538


git-svn-id: http://core.svn.wordpress.org/trunk@51149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 18:14:58 +00:00
desrosj
cf0f278ebe Build/Test Tools: Revert changes only included for testing purposes.
Follow up to [51535-51536].

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51537


git-svn-id: http://core.svn.wordpress.org/trunk@51148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 15:15:57 +00:00
desrosj
f45ed61786 Build/Test Tools: Correct invalid JSON in Slack payload.
The outer `”` marks are not required and produce invalid JSON.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51536


git-svn-id: http://core.svn.wordpress.org/trunk@51147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 15:08:56 +00:00
desrosj
a748075471 Build/Test Tools: Expand Slack notifications for GitHub Actions.
This expands Slack notifications to include success, cancelled, and “fixed” GitHub Action workflow run outcomes in addition to failures.

A “fixed” outcome occurs when the previous run for a workflow failed and the current one succeeds. This matches the behavior that was native to TravisCI by setting `on_success` for notifications to `change`.

The message details and where each outcome is posted is controlled by Slack workflows.

The Slack notification logic has also been pulled into a separate workflow to prevent repeating code in every workflow.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51535


git-svn-id: http://core.svn.wordpress.org/trunk@51146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 13:46:56 +00:00
Sergey Biryukov
def9fc3741 Coding Standards: Correct DateTimeZone class name in WP_Customize_Date_Time_Control::get_timezone_info().
Follow-up to [41626].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51534


git-svn-id: http://core.svn.wordpress.org/trunk@51145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 12:18:57 +00:00
Sergey Biryukov
5400c50367 Code Modernization: Pass correct default value to new DateTime() in wp_default_packages_inline_scripts().
This fixes a "Deprecated: `DateTime::__construct()`: Passing null to parameter #1 (`$datetime`) of type string is deprecated" warning on PHP 8.1.

Follow-up to [49083].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51533


git-svn-id: http://core.svn.wordpress.org/trunk@51144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 12:04:58 +00:00
Sergey Biryukov
fedcc33d27 Code Modernization: Silence the deprecation warnings for missing return type in WP_Block_List.
This fixes the "Deprecated: Return type of `WP_Block_List::[METHODNAME]()` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529], [51530], [51531].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:12:55 +00:00
Sergey Biryukov
68ba315d9a Code Modernization: Silence the deprecation warnings for missing return type in WP_REST_Request.
This fixes the "Deprecated: Return type of `WP_REST_Request::[METHODNAME]($offset)` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529], [51530].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:08:56 +00:00
Sergey Biryukov
85c1413c2b Code Modernization: Silence the deprecation warnings for missing return type in WP_Hook.
This fixes the "Deprecated: Return type of `WP_Hook::[METHODNAME]()` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:02:00 +00:00
Sergey Biryukov
3c14324dc6 Code Modernization: Silence the deprecation warnings for missing return type in WP_Theme.
This fixes the "Deprecated: Return type of `WP_Theme::[METHODNAME]($offset)` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 22:31:56 +00:00
Sergey Biryukov
9a4280c75f Upgrade/Install: Store correct result when bulk updating plugins or themes.
This ensures that when multiple plugins or themes are updated and one succeeds and another fails, the error is reported accordingly.

Previously, both updates would end up treated as a success, due to `$this->result` containing the result of the previous operation and not the current one.

Follow-up to [12097].

Props pwtyler, afragen.
Fixes #53002.
Built from https://develop.svn.wordpress.org/trunk@51528


git-svn-id: http://core.svn.wordpress.org/trunk@51139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 20:55:56 +00:00
Sergey Biryukov
b186e19855 Docs: Fix typo in the WP_Upgrader::install_package() description.
Follow-up to [30758].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 18:27:57 +00:00
Sergey Biryukov
2e707307d9 Coding Standards: Fix typo in the JS function name for handling the password reset button.
Follow-up to [50129].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51526


git-svn-id: http://core.svn.wordpress.org/trunk@51137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 16:48:57 +00:00
Sergey Biryukov
47fc56d650 Upgrade/Install: Avoid creating nonce during installation.
This avoids a "Table `wp_options` doesn't exist" database error when trying to create a nonce for password reset button.

When installing and using database-saved salts, `wp_create_nonce()` causes database errors as `wp_salt()` attempts to insert into the not-yet-created options table. Since authentication is not available during installation, we can safely skip creating a nonce.

Follow-up to [39684], [50129].

Props schlessera, swissspidy, sanketchodavadiya, hellofromTonya, SergeyBiryukov.
Fixes #53830.
Built from https://develop.svn.wordpress.org/trunk@51525


git-svn-id: http://core.svn.wordpress.org/trunk@51136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 16:39:00 +00:00
Sergey Biryukov
9e33977bc9 Themes: Make sure get_theme_mods() always returns an array.
This avoids a "Cannot access offset of type string on string" fatal error in `set_theme_mod()` on PHP 8 if the `theme_mods_$theme_slug` option has an incorrect value, e.g. an empty string instead of an array.

With this change, `set_theme_mod()` should be able to resolve the issue by saving a correct value.

Follow-up to [15736], [15739], [30672], [32629], [32632].

Props xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@51524


git-svn-id: http://core.svn.wordpress.org/trunk@51135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:55:56 +00:00
Sergey Biryukov
963dd5f06d Docs: Document the $wpdb global in WP_Debug_Data::get_mysql_var().
Follow-up to [51522].

See #53845.
Built from https://develop.svn.wordpress.org/trunk@51523


git-svn-id: http://core.svn.wordpress.org/trunk@51134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:04:56 +00:00
Sergey Biryukov
2a0191b901 Site Health: Add some more MySQL information to the Site Health Info screen.
This adds three values to the debug info in the Database section:

* Max allowed packet size
* Max connections number
* Query cache size

Props zodiac1978, donmhico, mukesh27, SergeyBiryukov.
Fixes #53845.
Built from https://develop.svn.wordpress.org/trunk@51522


git-svn-id: http://core.svn.wordpress.org/trunk@51133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:02:00 +00:00
Sergey Biryukov
aa0ed0fcdd Upgrade/Install: Skip any node_modules directories when removing Genericons example.html files on update.
This can significantly reduce the time required to complete the process in a development environment.

Follow-up to [32386].

Props bobbingwide, afragen, desrosj, SergeyBiryukov.
Fixes #52765.
Built from https://develop.svn.wordpress.org/trunk@51521


git-svn-id: http://core.svn.wordpress.org/trunk@51132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-31 10:32:56 +00:00
Sergey Biryukov
4889679ca5 Taxonomy: Pass correct default value for $post_id to wp_terms_checklist() in the posts list table.
This matches the documented type of the `$post_id` argument and is consistent with other instances of `wp_terms_checklist()` calls.

Per the function documentation, the default value is integer `0`, not `null`.

Follow-up to [13535].

Props tareiking, donmhico, jrf.
Fixes #43639.
Built from https://develop.svn.wordpress.org/trunk@51520


git-svn-id: http://core.svn.wordpress.org/trunk@51131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-31 09:50:57 +00:00
John Blackbourn
8935467410 Site Health: Standardise site health check status message punctuation.
Fixes #53594

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


git-svn-id: http://core.svn.wordpress.org/trunk@51130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 19:38:57 +00:00
John Blackbourn
2cb4ebefe2 Docs: Replace $this in hook param docs with more appropriate names.
`$this` is a pseudo-variable that cannot be used as the name of a function parameter, so renaming these helps prevent errors when implementing hook callback functions.

Fixes #53457

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


git-svn-id: http://core.svn.wordpress.org/trunk@51129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 19:35:58 +00:00
Sergey Biryukov
166dc3ac8e Code Modernization: Fix "JsonSerializable_Object::jsonSerialize() should be compatible with JsonSerializable::jsonSerialize(): mixed" error on PHP 8.1.
This relates to the [https://wiki.php.net/rfc/internal_method_return_types Return types for internal methods RFC] in PHP 8.1 and in particular, the change made in [https://github.com/php/php-src/pull/7051 PHP PR #7051], which adds a `mixed` return type to the `JsonSerializable::jsonSerialize()` interface method.

WordPress only contains one (test) class which implements the `JsonSerializable` interface and this commit fixes the issue for that class.

As of PHP 8.1, the `jsonSerialize()` method in classes which implement the `JsonSerializable` interface are expected to have a return type declared. The return type should be `mixed` or a more specific type. This complies with the Liskov principle of covariance, which allows the return type of a child overloaded method to be more specific than that of the parent.

The problem with this is that:
1. The `mixed` return type was only introduced in PHP 8.0.
2. Return types in general were only introduced in PHP 7.0.

WordPress still has a minimum PHP version of 5.6, so adding the return type is not feasible for the time being.

The solution chosen for now is to add an attribute to silence the deprecation warning. While attributes are a PHP 8.0+ feature, due to the choice of the `#[]` syntax, in PHP < 8.0, attributes will just be ignored and treated as comments, so there is no drawback to using the attribute.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 14:47:57 +00:00
John Blackbourn
a4bdae8122 Docs: Add missing documentation for the minute parameter of WP_Query.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 10:53:58 +00:00
John Blackbourn
ab9ed33f1d Docs: Correct the documented allowed range for the minute and second parameters of WP_Query.
These are correctly documented and validated in `WP_Date_Query` as 0-59.

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 10:23:57 +00:00
desrosj
9d6ea69d92 Build/Test Tools: Revert the test and coding standards changes in [51511].
These were temporary for testing Slack messages when GitHub Action workflows fail.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51512


git-svn-id: http://core.svn.wordpress.org/trunk@51123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 20:03:57 +00:00
desrosj
b5d09ecd99 Build/Test Tools: Post a message to #core in Slack when a workflow fails.
This adds an additional step to each GitHub Action workflow file that posts a message to #core in Slack every time a workflow run fails.

A minor test and spacing change is included in this commit in order to that messages are posted correctly and will be reverted after testing.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51511


git-svn-id: http://core.svn.wordpress.org/trunk@51122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 19:48:58 +00:00
Sergey Biryukov
ec25d0aad3 Themes: Add "Template Editing" to the list of WordPress theme features.
Follow-up to [meta11158].

Props poena, desrosj.
Fixes #53556. See #meta5802.
Built from https://develop.svn.wordpress.org/trunk@51510


git-svn-id: http://core.svn.wordpress.org/trunk@51121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 14:48:00 +00:00
gziolo
327852393a Build: Split packages and blocks to their webpack configs
It aligns with the changes proposed added in Gutenberg: https://github.com/WordPress/gutenberg/pull/33293.

The idea here is to split the growing webpack config into two parts: blocks and  packages.

We need to add handling for JavaScript files that are going to be used with blocks on the frontend. They didn't work quite well with the current setup for entry points created for packages.

As part of the effort, it adds support for `viewScript` in `block.json` metadata file that is later translated to `$view_script` in `WP_Block_Type` class and exposed as `view_script` from the REST API endpoint for block types.

Props youknowriad, desrosj, aristath.
Fixes #53690.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-28 10:06:59 +00:00
Sergey Biryukov
a207dadc10 Networks and Sites: Replace two remaining occurrences of "blog" with "site" in user-facing strings.
Follow-up to [36386], [36416], [36417], [46213].

Props audrasjb.
Fixes #53775.
Built from https://develop.svn.wordpress.org/trunk@51500


git-svn-id: http://core.svn.wordpress.org/trunk@51111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-28 10:02:00 +00:00
desrosj
28d78c0c37 Coding Standards: Apply some alignment fixes from composer format.
Follow up to [51475].

See #53729.
Built from https://develop.svn.wordpress.org/trunk@51499


git-svn-id: http://core.svn.wordpress.org/trunk@51110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 19:01:59 +00:00
desrosj
b055ff21bd Build/Test Tools: Remove the check for changes to version-controlled files in the Test Old Branch workflow.
This workflow does not perform a `git checkout` and is only used to dispatch workflows for old branches, so this check is not needed here.

Fixes #53799.
Built from https://develop.svn.wordpress.org/trunk@51498


git-svn-id: http://core.svn.wordpress.org/trunk@51109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 14:11:58 +00:00
desrosj
8f90cf9878 Upgrade/Install: Add files for 5.8 to the $_old_files list that were missed.
Follow up to [51133], [51459].

Props WFMattR, audrasjb, ocean90, johnbillion, pbiron.
Fixes #53702.
Built from https://develop.svn.wordpress.org/trunk@51497


git-svn-id: http://core.svn.wordpress.org/trunk@51108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 13:57:57 +00:00
Sergey Biryukov
0f9e2d2c66 Bundled Themes: Remove extra trailing spaces from translatable strings in block patterns.
Follow-up to [49583], [51045].

Props audrasjb, mukesh27.
Fixes #53774.
Built from https://develop.svn.wordpress.org/trunk@51496


git-svn-id: http://core.svn.wordpress.org/trunk@51107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 11:27:58 +00:00
Sergey Biryukov
1e6a658e2f Docs: Clarify the @return value for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117], [51494].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 11:01:57 +00:00
Sergey Biryukov
e86e6f8771 Docs: Correct @return type for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117].

Props ankitmaru, johnbillion.
Fixes #53793.
Built from https://develop.svn.wordpress.org/trunk@51494


git-svn-id: http://core.svn.wordpress.org/trunk@51105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 09:29:01 +00:00
Sergey Biryukov
0234409d58 Tests: Rename classes in phpunit/tests/widgets/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51493


git-svn-id: http://core.svn.wordpress.org/trunk@51104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 19:26:56 +00:00
Sergey Biryukov
5a12666dab Tests: Rename classes in phpunit/tests/sitemaps/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51492


git-svn-id: http://core.svn.wordpress.org/trunk@51103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 19:10:57 +00:00
Sergey Biryukov
142e0c4bd1 Tests: Rename classes in phpunit/tests/blocks/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51491


git-svn-id: http://core.svn.wordpress.org/trunk@51102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 18:46:57 +00:00
Sergey Biryukov
5a4203d04a Tests: Move and fix incorrectly placed tests for block supported styles.
The `Block_Supported_Styles_Test` class is not a `TestCase` to be extended, but an actual concrete test class. In order to run as expected, it should be placed under `phpunit/tests/blocks/` along with the other block tests.

Additionally:
* Add missing visibility keywords to test methods.
* Update the expected results to the currently used format for the tests to pass.
* Remove two outdated tests. The functionality being tested there is no longer available in this manner, so these tests are redundant.

Follow-up to [49226], [49310].

Props jrf, aristath, youknowriad.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51490


git-svn-id: http://core.svn.wordpress.org/trunk@51101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 17:41:01 +00:00
Peter Wilson
08e06d74af Bundled Themes: Version Bump 2010, 2011 and 2012.
Version bump three bundled themes to avoid file not found and fatal errors introduced for child themes during the 5.8 release cycle.

* Twenty Ten: Version 3.5 (fatal error & 404)
* Twenty Eleven: Version 3.9 (404)
* Twenty Twelve: Version 3.5 (404)

These updates will be released mid 5.8.1 cycle due to the severity of the issues.

Follow up to [51482,51483].

Props dd32, peterwilsoncc.
Fixes #53777.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 03:15:00 +00:00
Sergey Biryukov
b218b7504c Media: Check the posts_per_page value in wp_ajax_query_attachments() before using it as a divisor.
This avoids a "Division by zero" PHP warning if a plugin changes the `posts_per_page` value to zero.

Follow-up to [51145].

Props 2linctools, kapilpaul, audrasjb.
Fixes #53773.
Built from https://develop.svn.wordpress.org/trunk@51485


git-svn-id: http://core.svn.wordpress.org/trunk@51096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-25 09:56:57 +00:00
Sergey Biryukov
b67f94503e Media: Remove unused code from wp-admin/includes/media.php.
Folow-up to [7043], [7062].

Props rudlinkon, hellofromTonya.
Fixes #53764.
Built from https://develop.svn.wordpress.org/trunk@51484


git-svn-id: http://core.svn.wordpress.org/trunk@51095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-24 13:03:56 +00:00
Sergey Biryukov
f053aed3ce Bundled Themes: Use correct path for loading images in block patterns.
By using `get_template_directory_uri()` instead of `get_stylesheet_directory_uri()`, we make sure to include the images from the parent theme.

This avoids displaying missing images in block patterns when using a child theme of Twenty Ten, Twenty Eleven, or Twenty Twelve.

Follow-up to [51033], [51103], [51106].

Props audrasjb.
Fixes #53769.
Built from https://develop.svn.wordpress.org/trunk@51483


git-svn-id: http://core.svn.wordpress.org/trunk@51094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-24 12:42:00 +00:00
Sergey Biryukov
5ffbad0b42 Twenty Ten: Use correct path for loading block patterns.
By using `get_template_directory()` instead of `get_stylesheet_directory()`, we make sure to include the `block-patterns.php` file from the parent theme.

This avoids a PHP fatal error when using a child theme of Twenty Ten.

Follow-up to [51106].

Props ryelle, sabernhardt, loranrendel.
Fixes #53752.
Built from https://develop.svn.wordpress.org/trunk@51482


git-svn-id: http://core.svn.wordpress.org/trunk@51093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-23 13:13:58 +00:00
Sergey Biryukov
f753d70a82 Tests: Use better assertions in WP_UnitTestCase_Base::assertEqualFields():
* Check if the object attribute exists before checking its value.
* Mention the field name in error messages in case of failure.

Follow-up to [51478], [51479], [51480].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 18:50:57 +00:00
Sergey Biryukov
b38d2f9949 Tests: Modernize the WP_UnitTestCase_Base::assertEqualFields() method:
* Use `assertSame()` instead of `fail()` to display a proper message in case of failure.
* Add an optional `$message` parameter for consistency with other assertions.

Follow-up to [51478], [51479].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51480


git-svn-id: http://core.svn.wordpress.org/trunk@51091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:40:57 +00:00
Sergey Biryukov
79e24f3c28 Tests: Correct placement of the $message parameter in assertDiscardWhitespace().
Follow-up to [51478].

Props johnbillion.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51479


git-svn-id: http://core.svn.wordpress.org/trunk@51090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:26:57 +00:00
Sergey Biryukov
fa44974190 Tests: Add a $message parameter for custom assertions in WP_UnitTestCase_Base.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.

This optional parameter is now added for the assertion methods in the `WP_UnitTestCase_Base` class that were missing it.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:15:57 +00:00
John Blackbourn
0434d4d30b Docs: Miscellaneous docblock corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 16:54:58 +00:00
Sergey Biryukov
d19c7680e1 Tests: Correct class name for WP_Filesystem_Base::find_folder() tests.
A concrete test class should be suffixed with `Test`, not `UnitTestCase(s)`.

Follow-up to [25053].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 16:45:58 +00:00
Sergey Biryukov
8a90b8691f Docs: Add a comment about the $title global usage in various admin files.
This should make it clear that the variable is used as part of the HTML `<title>` tag on admin screens.

Props ravipatel, hellofromTonya, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #53729.
Built from https://develop.svn.wordpress.org/trunk@51475


git-svn-id: http://core.svn.wordpress.org/trunk@51086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 13:53:00 +00:00
Sergey Biryukov
8a975839f1 Docs: Correct a comment about WebP constants in wp-includes/compat.php.
Follow-up to [50810], [50814].

Props GaryJ, rtm909.
Fixes #53680.
Built from https://develop.svn.wordpress.org/trunk@51474


git-svn-id: http://core.svn.wordpress.org/trunk@51085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 13:07:57 +00:00
Sergey Biryukov
2871ef401b Help/About: Add / character to <img> and <source> tags.
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51418].

Props radixweb, ankitmaru, TobiasBg, sabernhardt, audrasjb.
Fixes #53716.
Built from https://develop.svn.wordpress.org/trunk@51473


git-svn-id: http://core.svn.wordpress.org/trunk@51084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 12:58:58 +00:00
gziolo
c7ff035183 I18n: Fix broken loop in WP_Theme_JSON_Resolver
Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/33552

The loop in WP_Theme_JSON_Resolver to extract translatable paths was broken, as it contained an immediate and unconditional return. This caused the loop to immediately exit again after the first iteration, thus never actually looping.

Follow-up to [50959].

Props schlessera.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@51083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 10:06:57 +00:00
gziolo
60c39d7805 Editor: Conditionally load registered styles for block variations
In WordPress 5.8 we added the ability to only load styles for blocks when these blocks are rendered. However, these optimizations left out block-styles that get added using the register_block_style() function/API.

Props aristath.
Fixes #53616.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 08:38:04 +00:00
Sergey Biryukov
352fe2a88f Build/Test Tools: Update PHP_CodeSniffer to version 3.6.0.
The latest releases contain various bugfixes, as well as (nearly complete) support for PHP 8.0.

Relevant changelogs:
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.6
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.7
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.6.0

For a full list of changes in this update, see the PHP_CodeSniffer GitHub:
https://github.com/squizlabs/PHP_CodeSniffer/compare/3.5.5...3.6.0

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


git-svn-id: http://core.svn.wordpress.org/trunk@51081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 14:32:03 +00:00
desrosj
32307b45b0 External Libraries: Correct the underscore version used when registering.
The correct version is `1.13.1`.

Follow up to [50650], [50778].

Props david.binda.
Fixes #53713.
Built from https://develop.svn.wordpress.org/trunk@51469


git-svn-id: http://core.svn.wordpress.org/trunk@51080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:33:59 +00:00
desrosj
bb6af43b34 External Libraries: Correct the jquery-form version used when registering.
The correct version is `4.3.0`.

Follow up to [50546].

Props david.binda.
Fixes #53714.
Built from https://develop.svn.wordpress.org/trunk@51468


git-svn-id: http://core.svn.wordpress.org/trunk@51079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:20:57 +00:00
desrosj
6574121d8a External Libraries: Correct the hoverIntent version used when registering.
Follow up to [50521].

Props david.binda.
Fixes #53715.
Built from https://develop.svn.wordpress.org/trunk@51467


git-svn-id: http://core.svn.wordpress.org/trunk@51078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:18:06 +00:00
John Blackbourn
f5713b8d71 Application Passwords: Improve various user-facing and developer-facing terminology.
Fixes #53503, #53691

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


git-svn-id: http://core.svn.wordpress.org/trunk@51074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 21:14:57 +00:00
Sergey Biryukov
77f6357eac Tests: Replace assertContains() with assertStringContainsString() when used with strings.
Using the `assertContains()` and `assertNotContains()` methods with string haystacks was deprecated in PHPUnit 8 and removed in PHPUnit 9.

While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.

These methods introduced in PHPUnit 7.5 should be used as an alternative:

* `assertStringContainsString()`
* `assertStringContainsStringIgnoringCase`
* `assertStringNotContainsString()`
* `assertStringNotContainsStringIgnoringCase`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods were added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51331], [51451], [51461].

Props jrf, dd32, SergeyBiryukov.
See #53363, #46149.
Built from https://develop.svn.wordpress.org/trunk@51462


git-svn-id: http://core.svn.wordpress.org/trunk@51073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 14:01:57 +00:00
Sergey Biryukov
1074ae9e4f Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertFalse( stripos( ... ) )` with `assertStringNotContainsString()` or `assertStringNotContainsStringIgnoringCase()` to use native PHPUnit functionality.

Going forward, these methods introduced in PHPUnit 7.5 should be used for similar assertions:

* `assertStringContainsString()`
* `assertStringContainsStringIgnoringCase()`
* `assertStringNotContainsString()`
* `assertStringNotContainsStringIgnoringCase()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449], [51451], [51453], [51454].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51461


git-svn-id: http://core.svn.wordpress.org/trunk@51072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 13:30:57 +00:00
desrosj
14f024a34a Upgrade/Install: Add additional files to $_old_files for 5.8.
Follow up to [51134].

Fixes #53367.
Built from https://develop.svn.wordpress.org/trunk@51459


git-svn-id: http://core.svn.wordpress.org/trunk@51070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 00:59:57 +00:00
desrosj
50db2d585f Build/Test Tools: Update the caniuse browser data and regenerate CSS.
This includes three minor updates to generated CSS files:

- A single `-webkit-` prefix is removed for `min-width`, which was required for Safari <= 10.1 (0.06% total global usage). WordPress only supports the last two versions.
- 2 instances where the `-o-` prefix are added for `tab-size`. This appears to be for Opera Mobile, which has creeped back over the 1% global usage.

Props peterwilsoncc, jorbin.
Fixes #53686.
Built from https://develop.svn.wordpress.org/trunk@51456


git-svn-id: http://core.svn.wordpress.org/trunk@51067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 00:41:57 +00:00
desrosj
29e534376c Bundled Themes: Bump bundled theme versions for WordPress 5.8.
This bumps the version for all bundle themes in preparation for release with WordPress 5.8. The new versions are as follows:

- Twenty Twenty-One: 1.4
- Twenty Twenty: 1.8
- Twenty Nineteen: 2.1
- Twenty Seventeen: 2.8
- Twenty Sixteen: 2.5
- Twenty Fifteen: 3.0
- Twenty Fourteen: 3.2
- Twenty Thirteen: 3.4
- Twenty Twelve: 3.4
- Twenty Eleven: 3.8
- Twenty Ten: 3.4

Props mukesh27, kapilpaul.
Fixes #53277.
Built from https://develop.svn.wordpress.org/trunk@51455


git-svn-id: http://core.svn.wordpress.org/trunk@51066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 23:05:00 +00:00
Sergey Biryukov
a86d4cbd85 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( ... > 0 )` with `assertGreaterThan()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449], [51451], [51453].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51454


git-svn-id: http://core.svn.wordpress.org/trunk@51065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 14:11:57 +00:00
Sergey Biryukov
232597b633 Tests: Use more appropriate assertions in rest_sanitize_request_arg() tests.
This replaces instances of `assertSame( true, ... )` with `assertTrue()` to use native PHPUnit functionality.

Follow-up to [38832].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51453


git-svn-id: http://core.svn.wordpress.org/trunk@51064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 14:01:58 +00:00
Sergey Biryukov
ff737b2d76 Tests: Require the WP_REST_Test_Controller class in WP_REST_Controller tests.
This avoids a "Class not found" PHP fatal error when running these tests separately.

Follow-up to [38832].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51452


git-svn-id: http://core.svn.wordpress.org/trunk@51063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 13:47:00 +00:00
Sergey Biryukov
e0c355fcaa Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( strpos( ... ) > 0 )` with `assertStringContainsString()` to use native PHPUnit functionality.

Going forward, these methods introduced in PHPUnit 7.5 should be used for similar assertions:

* `assertStringContainsString()`
* `assertStringNotContainsString()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51451


git-svn-id: http://core.svn.wordpress.org/trunk@51062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-17 10:37:58 +00:00
Sergey Biryukov
69a57fe80e Tests: Correct the test for autosaving a post with Ajax.
`wp_autosave()` only updates drafts and auto-drafts created by the current user if the post is not locked.

As a result of previous Ajax test refactoring, setting the current user and creating a test post ended up in different methods, with the user being set after the post is already created.

This resulted in the test post being created with the `post_author` field set to zero, and the current user check in `wp_autosave()` failed. Instead of updating the original post as the test intended, it created a new autosave.

The test only passed accidentally due to `assertGreaterThanOrEqual()` not performing a strict type check.

Follow-up to [26995], [35311].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51450


git-svn-id: http://core.svn.wordpress.org/trunk@51061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-17 10:24:59 +00:00
Sergey Biryukov
7bcca73ed7 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertSame( 0, strpos( ... ) )` with `assertStringStartsWith()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51449


git-svn-id: http://core.svn.wordpress.org/trunk@51060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-16 19:15:00 +00:00
Sergey Biryukov
4a8667c576 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_string( ... ) )` with `assertIsString()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51448


git-svn-id: http://core.svn.wordpress.org/trunk@51059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-16 09:52:00 +00:00
youknowriad
e76d4e1bcd Block Editor: Backport fixes targetted for WordPress 5.8 RC4.
This includes:

 - Suggestion List: Check if a node exists to scroll into view.
 - Autocomplete: reset state for empty text.
 - Adds auxiliary class names for editor styles in the widgets editor.
 - Extract snackbars into a separate component.
 - Rich text: run input rules after composition end.
 - iframe: load inline styles.
 - Multi select: select all: restore ref callback.
 - Writing flow: allow select all from empty selection.
 - Post Excerpt: Fix excerpt_more filter conflict and remove wordCount attribute.
 - Add the percent unit to the default units in Core.

Props desrosj.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 18:55:29 +00:00
desrosj
904862da90 Media: Document edge cases with the new image_editor_output_format filter.
More testing has revealed that the `image_editor_output_format` filter has some interesting edge cases that developers should be aware of when electing to use this filter (see #53667 and #53668).

Because this is a new filter that was intended to be used for experimenting with different ways to handle generating image sizes and has not yet been adopted in the wild, expanding the inline documentation is an acceptable temporary solution while these edge cases are explored further and addressed.

Props mikeschroder, antpb, desrosj, adamsilverstein, ianmjones.
See #5366, #53668, #35725.
Built from https://develop.svn.wordpress.org/trunk@51442


git-svn-id: http://core.svn.wordpress.org/trunk@51053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 17:39:59 +00:00
joedolson
f0e5f17c2c Media: Fix JS error in Media Library when infinite scroll enabled.
Wrap call to this.updateLoadMoreView() is wrapped in a check that infinite scroll is disabled to prevent JS errors.

Props wildworks.
Fixes #53672.
Built from https://develop.svn.wordpress.org/trunk@51440


git-svn-id: http://core.svn.wordpress.org/trunk@51051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 17:00:59 +00:00
Sergey Biryukov
1c4ec82ce7 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_numeric( ... ) )` with `assertIsNumeric()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51438


git-svn-id: http://core.svn.wordpress.org/trunk@51049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 14:45:56 +00:00
Sergey Biryukov
d3d8d166c8 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_a( ... ) )` with `assertInstanceOf()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51436


git-svn-id: http://core.svn.wordpress.org/trunk@51047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 09:08:01 +00:00
Andrew Ozz
15f9f7c6b9 Media: When resizing WebP images set the compression to "lossy" by default. Fixes a bug where the compression was set to "lossless" when the uploaded WebP images have extended file format (VP8X).
Props adamsilverstein, mikeschroder, mmxxi, linux4me2.
Fixes #53653.
Built from https://develop.svn.wordpress.org/trunk@51435


git-svn-id: http://core.svn.wordpress.org/trunk@51046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 00:43:00 +00:00
desrosj
88cedeac5c Bundled Themes: Revert the [51372] update to block patterns in bundled themes.
Upon further examination, this change was not great for backwards compatibility, resulting in block validation errors when running on older versions of WordPress.

While there are currently many `console.info()` notices caused by older format block syntax being updated to the current version included in WordPress 5.8, the blocks do not break.

Block patterns do not currently have a versioning mechanism, or a means to indicate which versions of WordPress are supported.

See #53617.
Built from https://develop.svn.wordpress.org/trunk@51434


git-svn-id: http://core.svn.wordpress.org/trunk@51045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 20:02:59 +00:00
desrosj
88309aa27e Widgets: Prevent widgets unintentionally being moved to the inactive sidebar.
This fixes a bug where widgets are unintentionally moved to the `wp_inactive_widgets` sidebar when batch updates occur through the REST API.

When batch requests are processed, only `$_wp_sidebars_widgets is updated by previous calls to `WP_REST_Widgets_Controller::create_item()`. `$sidebars_widgets` is not aware of the new widget’s intended location, and `retrieve_widgets()` mistakenly flags the widget as inactive.

Calling `wp_get_sidebars_widgets()` before `retrieve_widgets()` ensures both global variables match and is intended as a temporary fix until the root cause of the problem can be fixed.

Props zieladam, htmgarcia, timothyblynjacobs.
Fixes #53657.
Built from https://develop.svn.wordpress.org/trunk@51432


git-svn-id: http://core.svn.wordpress.org/trunk@51043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 16:45:58 +00:00
desrosj
440fd76242 Privacy: Ensure the copy button actually copies the suggested privacy policy text.
Follow up to [50609].

Props walbo, SergeyBiryukov.
Fixes #53652. See #52891.
Built from https://develop.svn.wordpress.org/trunk@51431


git-svn-id: http://core.svn.wordpress.org/trunk@51042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 16:17:59 +00:00
Sergey Biryukov
a727138559 Docs: Synchronize the $post_id argument description for some post and attachment functions.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@51430


git-svn-id: http://core.svn.wordpress.org/trunk@51041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 08:14:01 +00:00
desrosj
b8c451cdec Editor: Second round of package updates ahead of RC3.
Props ellatrix, peterwilsoncc, get_dave, mcsf, talldanwp, youknowriad, desrosj.
Built from https://develop.svn.wordpress.org/trunk@51426


git-svn-id: http://core.svn.wordpress.org/trunk@51037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 23:58:30 +00:00
Sergey Biryukov
10f7a91fa7 Docs: Correct documentation for wp_get_post_parent_id().
The `$post` parameter is required and does not have a default value.

Follow-up to [42397].

Props denisco.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@51425


git-svn-id: http://core.svn.wordpress.org/trunk@51036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 18:34:57 +00:00
desrosj
46f0cfe3ca Coding Standards: Use the correct formatting for multi-line comments.
Follow up to [51414].
Built from https://develop.svn.wordpress.org/trunk@51423


git-svn-id: http://core.svn.wordpress.org/trunk@51034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 18:02:57 +00:00
youknowriad
e270f4f0f3 Block Editor: Include the fixes targetted for WordPress 5.8 RC3.
This includes the following fixes:
 - Safari: see if compositing layer size is more reasonable when position fixed divs are not inserted into content.
 - Site Logo Block: update Site Logo block UI and option syncing.
 - Fix moving inner blocks in the Widgets Customizer.
 - Allow themes to provide empty values for color.duotone and spacing.units
 - Update getTermsInfo() to workaround parsing issue for translatable strings.
 - Specify what settings can be part of settings.layout.
 - Update conditions to hide duotone panel.
 - Prevent entering invalid values in the Query Loop block config.
 - Prevent color panel from showing as empty.
 - Avoid calling gutenberg_ functions within code shipped through WordPress Core.

Props desrosj.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 16:41:28 +00:00
Sergey Biryukov
8b2e5e7843 Tests: Reset $current_screen global between tests to avoid cross-test interdependencies.
This provides a consistent global starting state for tests that interact with admin screens.

Individual tests no longer need to invoke `set_current_screen( 'front' )` (or an alternative implementation) as a reset.

Follow-up to [29251], [29860], [31046], [36721], [38678], [48908], [50433].

Props hellofromTonya, johnbillion.
Fixes #53431.
Built from https://develop.svn.wordpress.org/trunk@51419


git-svn-id: http://core.svn.wordpress.org/trunk@51030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 16:14:58 +00:00
ryelle
f1e1a53f5a Help/About: Update the About page for 5.8.
Use a larger image for theme.json on retina screens, and update the spacing of sections on the page.

Props javiarce.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 15:39:57 +00:00
Mike Schroder
b95e0b391c Customizer: Don’t always set normalizedTransitionendEventName to null.
Reverts [51389].

Unprops mikeschroder.
See #53562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 14:04:57 +00:00
Sergey Biryukov
8ed1859c35 Tests: Clean up skipping conditions and requirements for various tests.
This improves the consistency of test skipping and ensures that:

* The `@requires` annotations use the right condition and format, and are on the right level (class vs. function).
* Inline conditions with a `markTestSkipped()` call are only used when annotations cannot be used.
* All `markTestSkipped()` calls contain a verbose explanation of why the test is being skipped.

Props jrf, hellofromTonya.
Fixes #53009.
Built from https://develop.svn.wordpress.org/trunk@51415


git-svn-id: http://core.svn.wordpress.org/trunk@51026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 10:45:02 +00:00
Peter Wilson
34119e2c95 Widgets: Validate HTML before saving block widgets.
Props talldanwp, noisysocks, kevin940726, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 05:59:01 +00:00
ryelle
a5cfc54fec Help/About: Update the About section for 5.8.
Update the image links to use the CDN. Use regular text color for headings. Fix two string issues. Remove unnecessary `wp-components` script & style.

Props nao, audrasjb, karmatosed, desrosj, javiarce, milana_cap.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 00:12:56 +00:00
desrosj
f2b3c983f6 Docs: Various documentation fixes following [51129].
- Typo corrections in filter descriptions.
- DocBlocks are now now wrapped to the next line after 80 characters, and not extending beyond 120 total characters wide.
- Remove unnecessary repeated references to the suggested replacement hooks.
- Adjustments to the indentation for consistency with other emails in Core, allowing the `phpcs:ignore` comment to be removed.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 00:02:57 +00:00
desrosj
b60650f5bd Widgets: Replace wp.editor references in the legacy text widget.
This changes the references to `wp.editor` in the text widget’s JavaScript to `wp.oldEditor`, which is the new location for the old `editor` script that was previously available at `window.wp.editor`. 

Follow up to [51387-51388,51390].

Props spacedmonkey, zieladam.
Fixes #53437.
Built from https://develop.svn.wordpress.org/trunk@51409


git-svn-id: http://core.svn.wordpress.org/trunk@51020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 23:57:57 +00:00
desrosj
a3a7ccf107 Widgets: Use wp_sidebar_description() to retrieve a sidebar’s description.
This switches `WP_REST_Sidebars_Controller` to use `wp_sidebar_description()` for retrieving the `description` of a given sidebar instead of referencing the value in the `$wp_registered_sidebars` global variable directly.

`wp_sidebar_description()` uses `wp_kses()` to only allow the default list of `$allowed_tags` to be present in a sidebar’s `description`.

Props timothyblynjacobs, desrosj.
Fixes #53646.
Built from https://develop.svn.wordpress.org/trunk@51408


git-svn-id: http://core.svn.wordpress.org/trunk@51019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 19:03:57 +00:00
Sergey Biryukov
2276bef421 Coding Standards: Fix WPCS issue in [51404].
This fixes an "Expected 1 spaces before closing parenthesis; 0 found" error.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51405


git-svn-id: http://core.svn.wordpress.org/trunk@51016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 10:53:59 +00:00