Commit Graph

19065 Commits

Author SHA1 Message Date
Sergey Biryukov
2ed4b82cb0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51541 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-04 14:22:37 +00:00
Peter Wilson
601ae4a6b2 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51540 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-04 05:09:08 +00:00
Peter Wilson
bed17098b8 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51539 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-04 04:59:46 +00:00
Jorge Costa
5951c60aed 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51538 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 18:13:46 +00:00
Jonathan Desrosiers
3148181925 Build/Test Tools: Revert changes only included for testing purposes.
Follow up to [51535-51536].

See #52644.

git-svn-id: https://develop.svn.wordpress.org/trunk@51537 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 15:14:03 +00:00
Jonathan Desrosiers
ce0396ba76 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51535 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 13:45:02 +00:00
Sergey Biryukov
f117c74c6a Coding Standards: Correct DateTimeZone class name in WP_Customize_Date_Time_Control::get_timezone_info().
Follow-up to [41626].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51534 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 12:17:54 +00:00
Sergey Biryukov
a5de731f9e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51533 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 12:03:41 +00:00
Sergey Biryukov
9f3c2be1d0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51532 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 11:11:45 +00:00
Sergey Biryukov
289c9c7248 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51531 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 11:07:28 +00:00
Sergey Biryukov
471edb0193 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51530 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-03 11:00:50 +00:00
Sergey Biryukov
df724f991b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51529 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-02 22:30:04 +00:00
Sergey Biryukov
717158ee32 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51528 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-02 20:54:44 +00:00
Sergey Biryukov
80ccb3697c Docs: Fix typo in the WP_Upgrader::install_package() description.
Follow-up to [30758].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51527 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-02 18:26:34 +00:00
Sergey Biryukov
1ea9ce390d Coding Standards: Fix typo in the JS function name for handling the password reset button.
Follow-up to [50129].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51526 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-02 16:47:38 +00:00
Sergey Biryukov
3a189c93e1 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51525 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-02 16:37:57 +00:00
Sergey Biryukov
2ba4a4817a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51524 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-01 14:54:52 +00:00
Sergey Biryukov
ac47170bb5 Docs: Document the $wpdb global in WP_Debug_Data::get_mysql_var().
Follow-up to [51522].

See #53845.

git-svn-id: https://develop.svn.wordpress.org/trunk@51523 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-01 14:03:09 +00:00
Sergey Biryukov
495f4f7641 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51522 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-01 14:00:17 +00:00
Sergey Biryukov
d373e6e0d6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51521 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-31 10:31:51 +00:00
Sergey Biryukov
812d110c5d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51520 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-31 09:49:35 +00:00
John Blackbourn
8f3d2b46ad Site Health: Standardise site health check status message punctuation.
Fixes #53594


git-svn-id: https://develop.svn.wordpress.org/trunk@51519 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-30 19:37:54 +00:00
John Blackbourn
4205214eba 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


git-svn-id: https://develop.svn.wordpress.org/trunk@51518 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-30 19:34:39 +00:00
John Blackbourn
108d4d1ae5 Docs: Add missing documentation for the minute parameter of WP_Query.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51514 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-30 10:52:39 +00:00
John Blackbourn
ccbfd22833 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


git-svn-id: https://develop.svn.wordpress.org/trunk@51513 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-30 10:22:11 +00:00
Jonathan Desrosiers
12a820379a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51512 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-29 20:02:53 +00:00
Jonathan Desrosiers
7a60b8eb8b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51511 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-29 19:47:43 +00:00
Sergey Biryukov
2905c5a9bc Themes: Add "Template Editing" to the list of WordPress theme features.
Follow-up to [meta11158].

Props poena, desrosj.
Fixes #53556. See #meta5802.

git-svn-id: https://develop.svn.wordpress.org/trunk@51510 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-29 14:46:48 +00:00
gziolo
ad976addb3 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51501 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-28 10:05:01 +00:00
Sergey Biryukov
31c328d990 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51500 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-28 10:00:51 +00:00
Jonathan Desrosiers
e6ed1b2be9 Coding Standards: Apply some alignment fixes from composer format.
Follow up to [51475].

See #53729.

git-svn-id: https://develop.svn.wordpress.org/trunk@51499 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 19:00:54 +00:00
Jonathan Desrosiers
82e4df4cce 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51497 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 13:56:54 +00:00
Sergey Biryukov
38891dbbcb Bundled Themes: Remove extra trailing spaces from translatable strings in block patterns.
Follow-up to [49583], [51045].

Props audrasjb, mukesh27.
Fixes #53774.

git-svn-id: https://develop.svn.wordpress.org/trunk@51496 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 11:26:23 +00:00
Sergey Biryukov
3207c62104 Docs: Clarify the @return value for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117], [51494].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51495 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 11:00:25 +00:00
Sergey Biryukov
7bb0a17b46 Docs: Correct @return type for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117].

Props ankitmaru, johnbillion.
Fixes #53793.

git-svn-id: https://develop.svn.wordpress.org/trunk@51494 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-27 09:27:51 +00:00
Peter Wilson
000068f637 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51486 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-26 03:13:19 +00:00
Sergey Biryukov
9ea5645ec2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51485 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-25 09:55:33 +00:00
Sergey Biryukov
301eb3c8f6 Media: Remove unused code from wp-admin/includes/media.php.
Folow-up to [7043], [7062].

Props rudlinkon, hellofromTonya.
Fixes #53764.

git-svn-id: https://develop.svn.wordpress.org/trunk@51484 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-24 13:02:29 +00:00
Sergey Biryukov
c696a2f773 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51483 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-24 12:40:28 +00:00
Sergey Biryukov
bedd023c3a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51482 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-23 13:12:31 +00:00
John Blackbourn
0871a0ddc2 Docs: Miscellaneous docblock corrections and improvements.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51477 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 16:53:59 +00:00
Sergey Biryukov
41df21e70d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51475 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 13:51:58 +00:00
Sergey Biryukov
49b11dcad7 Docs: Correct a comment about WebP constants in wp-includes/compat.php.
Follow-up to [50810], [50814].

Props GaryJ, rtm909.
Fixes #53680.

git-svn-id: https://develop.svn.wordpress.org/trunk@51474 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 13:06:55 +00:00
Sergey Biryukov
70c9aabf0d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51473 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 12:57:48 +00:00
Greg Ziółkowski
3f83b50743 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.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@51472 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 10:05:33 +00:00
Greg Ziółkowski
211d94b710 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@51471 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-22 08:36:11 +00:00
Jonathan Desrosiers
09bbc174c0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51469 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-21 12:32:57 +00:00
Jonathan Desrosiers
ca214a3b4c 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51468 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-21 12:19:26 +00:00
Jonathan Desrosiers
0e08acda70 External Libraries: Correct the hoverIntent version used when registering.
Follow up to [50521].

Props david.binda.
Fixes #53715.

git-svn-id: https://develop.svn.wordpress.org/trunk@51467 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-21 12:16:35 +00:00
John Blackbourn
0167d6dd50 Application Passwords: Improve various user-facing and developer-facing terminology.
Fixes #53503, #53691


git-svn-id: https://develop.svn.wordpress.org/trunk@51463 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-19 21:13:36 +00:00