Commit Graph

22429 Commits

Author SHA1 Message Date
Aaron Jorbin
5e201d4b5b Build/Test: Add Tests for wp_scheduled_delete.
Props pbearne.
Fixes #59938.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 15:22:24 +00:00
Sergey Biryukov
9b905f9573 Docs: Remove unused $posts global reference in get_attachment_template().
Follow-up to [32628], [32804].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57223


git-svn-id: http://core.svn.wordpress.org/trunk@56729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 14:52:21 +00:00
isabel_brison
6e1fe93a1c REST API: check parent and revision ids match before retrieving revision.
Adds a condition to check that parent id matches revision parent id in `WP_REST_Revisions_Controller` `get_item` method.

Props ramonopoly, adamsilverstein, danielbachhuber, spacedmonkey, andrewserong.
Fixes #59875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 02:12:21 +00:00
desrosj
45c67f7f11 Build/Test Tools: Add missing MySQL versions for WordPress 5.0.
Follow up to [57218], [57219], [57220].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57221


git-svn-id: http://core.svn.wordpress.org/trunk@56727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:38:23 +00:00
desrosj
8a4bef5bcb Build/Test Tools: Run installation tests when data files are updated.
When the JSON data files that supply the PHP/MySQL version support to the installation test workflow are changed, the workflow should be run to confirm the changes are correct. This updates the `path` filtering rules to ensure this happens.

Follow up to [57218], [57219].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57220


git-svn-id: http://core.svn.wordpress.org/trunk@56726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:23:21 +00:00
desrosj
d8d6bee968 Build/Test Tools: Add missing PHP versions for 6.5 and 6.4.
This adds 6.4 and 6.5 to the PHP version support JSON files used to build the test matrix in the Installation Testing workflow.

Also, WP 6.3 did not support PHP 8.3.

Follow up to [57218].

See #58977.
Built from https://develop.svn.wordpress.org/trunk@57219


git-svn-id: http://core.svn.wordpress.org/trunk@56725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:14:20 +00:00
desrosj
f692428328 Build/Test Tools: Make the install testing workflow more flexible.
In [56661], a new GitHub Actions workflow was introduced that focused on running some minimal installation tests for a version of WordPress for every PHP and MySQL combination.

This workflow has tested well, but lacks flexibility and possesses one flaw: tests are only ever performed with currently supported versions, even if the version being tested had a different support policy.

This updates the workflow to be more flexible, allowing all versions of WordPress currently receiving security fixes (back through 4.1) to be tested under the correct support policy.

Additionally, the workflow can now run against the `nightly` build of WordPress. This replaces `latest` as the new default. This allows the tests to be run at any point during a release cycle without the need for an officially tagged version.

Props jorbin, joemcgill, costdev.
See #58977.
Built from https://develop.svn.wordpress.org/trunk@57218


git-svn-id: http://core.svn.wordpress.org/trunk@56724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-22 01:00:20 +00:00
Aaron Jorbin
2aee859fbf Build/Test: Update Grunt Patch Wordpress for Node 20+.
Props jorbin, desrosj.
See #59658, #59663.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-21 20:03:26 +00:00
Sergey Biryukov
af1f54d6b3 Docs: Document some globals in wp-includes/widgets.php.
Follow-up to [41555], [50995].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57216


git-svn-id: http://core.svn.wordpress.org/trunk@56722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-21 18:36:23 +00:00
Joe McGill
5b5e874ed5 Themes: Improve the performance of _get_block_templates_paths.
This avoids redundant recursive lookups for block template paths in the same base directory by implementing a static cache. It also replaces an potentially expensive `file_exists` call in favor of doing recursive iteration of files inside a try/catch block. 

Props thekt12, spacedmonkey, flixos90, mukesh27, joemcgill.
Fixes #58196.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 20:02:16 +00:00
desrosj
f5e051855d Build/Test Tools: Add engines for default themes.
This adds the `engines` field to the `package.json` file for the three default themes with build processes in order to encourage consistent tooling for contributors.

Some minor dependency updates for these themes are also included in this change.

Props jorbin, joemcgill, swissspidy.
See #59663.
Built from https://develop.svn.wordpress.org/trunk@57213


git-svn-id: http://core.svn.wordpress.org/trunk@56719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 18:52:15 +00:00
desrosj
775f4c4416 Build/Test Tools: Raise minimum required version of Node.js/npm.
This bumps the minimum required version of Node.js/npm from 16.19.1 and 8.19.3 to 20.10.0 and 10.2.3.

Since 20.10.0 is the latest 20.x version of Node.js, the `check-latest` option has been enabled for `actions/setup-node` in GitHub Actions workflows. This performs an additional external call to the Node.js API confirming the latest version is installed on the runner for use. In testing, it seems that 20.10.0 was not consistently deployed to all runner machines in use. This should be removed in the near future when the version of Node.js is reliably above the new minimum requirement.

The Gutenberg repository has also been updated to use the same values for `engines`.

Props jorbin, joemcgill, swissspidy, benharri, dhrupo, flootr, gziolo, noahtallen.
See #59663.
Built from https://develop.svn.wordpress.org/trunk@57212


git-svn-id: http://core.svn.wordpress.org/trunk@56718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 18:46:20 +00:00
Bernhard Reiter
8e5db640de HTML API: Avoid processing incomplete tokens.
Currently the Tag Processor assumes that an input document is a ''full'' HTML document. Because of this, if there's lingering content after the last tag match it will treat that content as plaintext and skip over it. This is fine for the Tag Processor because if there is lingering content that isn't a valid tag then there's nothing for `next_tag()` to match.

However, in order to support a number of feature expansions it is important to recognize that the remaining content ''may'' involve partial syntax elements, such as incomplete tags, attributes, or comments.

In this patch we're adding a mode inside the Tag Processor which will flip when we start parsing HTML syntax but the document finishes before the token does. This will provide the ability to:

- extend the input document,
- avoid misinterpreting syntax as text, and
- guess if we have a complete document, know if we have an incomplete document.

In the process of building this patch a few fixes were identified and fixed in the Tag Processor, namely in the handling of incomplete syntax elements.

Props dmsnell, jonsurrell.
Fixes #60122, #60108.
Built from https://develop.svn.wordpress.org/trunk@57211


git-svn-id: http://core.svn.wordpress.org/trunk@56717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 17:52:30 +00:00
Pascal Birchler
ed17b41079 Build/Test Tools: Post message for testing on Playground only after build succeeds.
Uses the `workflow_run` trigger to only leave pull request comments after the build jobs finish.

Props zieladam, desrosj.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57210


git-svn-id: http://core.svn.wordpress.org/trunk@56716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 14:52:33 +00:00
Bernhard Reiter
a586b85d8e HTML API: Apply linting changes to @TODO comments.
Lowercase `@TODO` comments introduced by [57186], and remove spurious colons after them.

Props dmsnell, TobiasBg, mukesh27, sergeybiryukov, jonsurrell.
Fixes #60060.
Built from https://develop.svn.wordpress.org/trunk@57209


git-svn-id: http://core.svn.wordpress.org/trunk@56715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 12:36:31 +00:00
Sergey Biryukov
8dd4ce9fdb Tests: Correct the @group annotation for _wp_mysql_week() tests.
Includes updating the data provider name for consistency.

Follow-up to [57207].

See #59931.
Built from https://develop.svn.wordpress.org/trunk@57208


git-svn-id: http://core.svn.wordpress.org/trunk@56714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-20 10:03:35 +00:00
Aaron Jorbin
2f1335258f Build/Test: Add Tests for _wp_mysql_week.
Props pbearne.
Fixes #59931.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-19 23:13:32 +00:00
Sergey Biryukov
a559c54aef Docs: Document the $shortcode_tags global in wp_just_in_time_script_localization().
Follow-up to [41395], [41844].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57204


git-svn-id: http://core.svn.wordpress.org/trunk@56712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-19 13:12:27 +00:00
desrosj
0244f702f0 Build/Test Tools: Add more context to artifact names.
This adds a bit more context to the E2E workflow artifact names in order to avoid duplicates being uploaded.

With the update to v4 of `actions/upload-artifact` in [57197], artifacts are now uploaded on a per job basis. Multiple jobs cannot upload the same artifact.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 20:34:29 +00:00
desrosj
36adf3d10b Build/Test Tools: Update third-party GitHub Actions.
This updates the following GitHub Actions to their latest versions:
- `actions/checkout`
- `actions/setup-node`
- `actions/upload-artifact`
- `actions/cache`
- `actions/github-script`
- `shivammathur/setup-php`

See #59805.
Built from https://develop.svn.wordpress.org/trunk@57197


git-svn-id: http://core.svn.wordpress.org/trunk@56708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 15:20:27 +00:00
Sergey Biryukov
b691849290 Docs: Document some globals in wp-includes/deprecated.php.
Includes removing `$allowed_options` global references from functions where it's not actually used.

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57196


git-svn-id: http://core.svn.wordpress.org/trunk@56707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-18 13:53:30 +00:00
Sergey Biryukov
a9b08b8e16 Docs: Correct $wp_the_query global reference in WP_Query::is_main_query().
Follow-up to [18699], [32620], [34337], [45739].

See #59651.
Built from https://develop.svn.wordpress.org/trunk@57195


git-svn-id: http://core.svn.wordpress.org/trunk@56706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-17 02:48:29 +00:00
Sergey Biryukov
fac2864841 Docs: Document the $wp_locale global in WP_Fatal_Error_Handler::handle().
Follow-up to [45277].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57194


git-svn-id: http://core.svn.wordpress.org/trunk@56705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-16 09:38:25 +00:00
Sergey Biryukov
5883e53bbf Docs: Document the $current_screen global in _WP_Editors::editor().
Follow-up to [32899].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57193


git-svn-id: http://core.svn.wordpress.org/trunk@56704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-16 09:31:29 +00:00
Sergey Biryukov
f0e266fd62 General: Revert code changes from [57191].
The unit tests for `get_bookmark()` expect the function to modify the `$GLOBALS` array directly.

Follow-up to [57191].

See #60021.
Built from https://develop.svn.wordpress.org/trunk@57192


git-svn-id: http://core.svn.wordpress.org/trunk@56703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 14:33:25 +00:00
Sergey Biryukov
e162ffa2e9 Docs: Document the $link global in get_bookmark().
Follow-up to [8758].

Props upadalavipul, mukesh27.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57191


git-svn-id: http://core.svn.wordpress.org/trunk@56702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 12:59:23 +00:00
Sergey Biryukov
c07e1c4442 Docs: Document the $wpdb global in WP_User::__construct().
Follow-up to [19325].

Props upadalavipul.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57190


git-svn-id: http://core.svn.wordpress.org/trunk@56701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-15 12:37:29 +00:00
Sergey Biryukov
8361461aa0 Docs: Fix typo in WP_Date_Query::build_mysql_datetime() DocBlock.
Follow-up to [25139].

Props nithi22, benniledl, mukesh27.
Fixes #60067.
Built from https://develop.svn.wordpress.org/trunk@57189


git-svn-id: http://core.svn.wordpress.org/trunk@56700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-14 10:23:27 +00:00
Sergey Biryukov
8ed54ba817 Toolbar: Add a Plugins link to the admin bar menu.
Props colomet, Girishpanchal, afercia, danieltj, rishishah, sabernhardt, joedolson,  huzaifaalmesbah, shailu25, zunaid321, devmuhib, sumitbagthariya16, yuvrajsinh2211, SergeyBiryukov.
Fixes #40683.
Built from https://develop.svn.wordpress.org/trunk@57188


git-svn-id: http://core.svn.wordpress.org/trunk@56699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 21:18:19 +00:00
Aaron Jorbin
497844c45b Build/Test: Update name of test to show its breadth.
The test covers multiple libraries, not just lodash.

Follow up to [57185].

Props TobiasBg.
Fixes #60048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 20:02:23 +00:00
Bernhard Reiter
511dcb7520 HTML API: Add support for H1-H6 elements in the HTML Processor.
Previously these have been unsupported, but in this patch, support is added for the tags so that the HTML Processor can process documents containing them.

There was a design discussion about introducing a constant to communicate "any of the H1 - H6 elements" but this posed a number of challenges that don't need to be answered in this patch. For the time being, because the HTML specification treats H1 - H6 specially as a single kind of element, the HTML Processor uses an internal hard-coded string to indicate this. By using a hard-coded string it's possible to avoid introducing a class constant which cannot be made private due to PHP's class design. In the future, this will probably appear as a special constant in a new constant-containing class.

Props dmsnell, jonsurrell.
Fixes #60060.
Built from https://develop.svn.wordpress.org/trunk@57186


git-svn-id: http://core.svn.wordpress.org/trunk@56697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 17:53:19 +00:00
Aaron Jorbin
d5b96bf00d External Libraries: For Lodash, sync the declared version number with the one that is loaded.
In [50941] the version of lodash was updated, however the version inside `wp_default_packages_vendor` was not updated at the same time. This updates the version to correctly reflect the version that is loaded.

Also adds some basic tests for the scripts in `wp_default_packages_vendor` that match the name of the package from package.json to help prevent errors like this in the future.

Props jadpm, jorbin, swissspidy.
Fixes #60048. See #52991.



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


git-svn-id: http://core.svn.wordpress.org/trunk@56696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-13 17:50:31 +00:00
Sergey Biryukov
e99a116006 Tests: Add unit tests for wp_checkdate().
Follow-up to [21922].

Props pbearne, ironprogrammer, antonvlasenko, SergeyBiryukov.
Fixes #59825.
Built from https://develop.svn.wordpress.org/trunk@57184


git-svn-id: http://core.svn.wordpress.org/trunk@56695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-12 12:21:24 +00:00
Sergey Biryukov
a2bcc36278 Docs: Consistently document the $body_id global as a string.
Includes declaring the global at the beginning of `wp_iframe()` and `iframe_header()`.

Follow-up to [32642], [32643].

Props mukesh27, upadalavipul.
Fixes #60032.
Built from https://develop.svn.wordpress.org/trunk@57181


git-svn-id: http://core.svn.wordpress.org/trunk@56692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-11 12:11:22 +00:00
desrosj
fb4428dd60 Build/Test Tools: Group GitHub Action Dependabot updates.
This updates the Dependabot configuration file to make use of `groups`, configuring all third-party GitHub Action updates available into a single pull request to help reduce noise.

Props bradparbs.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57180


git-svn-id: http://core.svn.wordpress.org/trunk@56691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-11 11:50:27 +00:00
zieladam
760fae6c43 HTML API: Track spans of text with (offset, length) instead of (start, end).
Updates the internal representation of the text span coordinates. The mixture of (offset, length) and (start, end) coordinates becomes confusing, this commit replaces it with a (offset, length) pair. There should be no functional or behavioral changes in this patch. For the internal helper classes this patch introduces breaking changes, but those classes are marked private and should not be used outside of the HTML API itself.

Props dmsnell.
Fixes #59993.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 13:19:28 +00:00
zieladam
6af9b0dcfe Build/Test Tools: Fix the workflow that posts a preview link on every Pull Request
Fixes a 403 error in the pull-request-comments.yml job by switching from a custom workflow dispatch call to the pull_request_target trigger.

Follow up to [57124], [57174].
Props ockham.
See #59416.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 10:36:39 +00:00
Sergey Biryukov
83ad6a8b86 Docs: Correct the order of steps in the WordPress Core build process workflow.
Follow up to [57124], [57174].

Props swissspidy.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57177


git-svn-id: http://core.svn.wordpress.org/trunk@56688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-10 00:21:31 +00:00
Sergey Biryukov
a192ed1ae1 REST API: Pass correct number of arguments to the comment_text filter.
This ensures that `WP_REST_Comments_Controller::prepare_item_for_response()` passes three arguments to the `comment_text` filter, for consistency with all the other instances in core.

Follow-up to [15957], [16357], [25555], [38832], [40664].

Props sjregan, SergeyBiryukov.
Fixes #58238.
Built from https://develop.svn.wordpress.org/trunk@57176


git-svn-id: http://core.svn.wordpress.org/trunk@56687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-09 22:13:34 +00:00
Sergey Biryukov
1c7d7a09aa Upload: Add missing escaping in upload_space_setting().
Follow-up to [https://mu.trac.wordpress.org/changeset/1088 mu:1088], [https://mu.trac.wordpress.org/changeset/1095 mu:1095], [12603].

Props utsav72640.
Fixes #58514.
Built from https://develop.svn.wordpress.org/trunk@57175


git-svn-id: http://core.svn.wordpress.org/trunk@56686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 21:26:29 +00:00
zieladam
afb55f3571 Build/Test Tools: Zip WordPress files before npm run clean
Fixes a problem in WordPress artifact upload pipeline. The callable-test-core-build-process.yml used to zip the WordPress dist directory after npm run grunt clean runs, producing an empty zip file. This commit moves the zip before the cleanup task.

Follow up to [57124].

Props ockham, dmsnell.
See #59416.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 16:07:28 +00:00
desrosj
362b15d400 Database: Raise the minimum required version of MySQL.
This raises the minimum version of MySQL required to run WordPress from 5.0 to 5.5.5.

MySQL 5.0 and 5.1 have long been unsupported and both reached end of life over 10 years ago. Combined usage for both versions sits at 0.4% of all WordPress sites.

Because 5.5 sits at just under 15% usage, 5.5 cannot be trimmed off at this time.

Of all sites running 5.5.x, 85% are running 5.5.5, and 100% are running 5.5.5 or higher. This makes it the logical landing spot.

Props johnbillion, sergeybiryukov, jorbin.
Fixes #60036.
Built from https://develop.svn.wordpress.org/trunk@57173


git-svn-id: http://core.svn.wordpress.org/trunk@56684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 14:13:27 +00:00
Bernhard Reiter
ed04994d13 Block Hooks: Fix @ticket references in tests, add missing ones.
Some tests that were added in [57157] erroneously set their `@ticket` reference to #59646, rather than #60008.
This changeset rectifies that mistake.

Additionally, it adds ticket references to #60008 to tests that were modified by [57157].

Follow-up to [57157].

See #60008.
Built from https://develop.svn.wordpress.org/trunk@57172


git-svn-id: http://core.svn.wordpress.org/trunk@56683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 11:46:27 +00:00
isabel_brison
cf50fd40f5 Themes: fix documentation link.
Removes a period from an inline comment of `wp_block_theme_activate_nonce` that broke a link in the comment.

Props stevenlinx, mukesh27.
Fixes #60034.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 06:32:24 +00:00
Felix Arntz
7926dbb4d5 General: Avoid early initialization of variable in get_bloginfo().
This is a very minor, yet simple performance optimization in a commonly called function, avoiding unnecessary initialization of the `$url` variable when it may not be needed. The conditional is simple enough to not use a variable altogether.

Props Cybr, swissspidy.
Fixes #59450.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-07 22:57:28 +00:00
Sergey Biryukov
f402ce754d Docs: Improve documentation for Custom_Image_Header and Custom_Background constructors.
Follow-up to [4673], [8656], [12890], [13041].

Props faisalahammad, cadic.
Fixes #58049.
Built from https://develop.svn.wordpress.org/trunk@57169


git-svn-id: http://core.svn.wordpress.org/trunk@56680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-07 15:14:27 +00:00
Joe McGill
46406afcc4 HTML-API: Prevent unintended behavior when WP_HTML_Token is unserialized.
Props dmsnell, peterwilsoncc, dd32, xknown, rawrly, johnbillion, barry, jeffpaul, vortfu, isabel_brison, mikeschroder, jorbin.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 16:05:19 +00:00
Sergey Biryukov
ebb9657bf7 Docs: Fix typo in Gettext_Translations::parenthesize_plural_exression() description.
Follow-up to [10584], [12079], [41722], [57161].

Props tohincoderex.
See #59347.
Built from https://develop.svn.wordpress.org/trunk@57162


git-svn-id: http://core.svn.wordpress.org/trunk@56673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 11:54:17 +00:00
Sergey Biryukov
e0d74dfb10 I18N: Deprecate Gettext_Translations::parenthesize_plural_exression().
Aside from having a typo in the name, the method is unused by core as of WordPress 4.9.

Follow-up to [10584], [12079], [41722].

Props tohincoderex, jrf.
Fixes #59347.
Built from https://develop.svn.wordpress.org/trunk@57161


git-svn-id: http://core.svn.wordpress.org/trunk@56672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-06 11:50:26 +00:00
Sergey Biryukov
7eec58966d Administration: Don't unnecessarily escape none or div in the admin menu.
This matches a similar conditional in `wp-admin/menu-header.php`, where these values are handled as special cases and don't output the default menu image so that an icon could be added to `div.wp-menu-image` as CSS background. 

Follow-up to [9578], [21877], [26664].

Props andrewleap, ironprogrammer, azaozz.
Fixes #58361.
Built from https://develop.svn.wordpress.org/trunk@57159


git-svn-id: http://core.svn.wordpress.org/trunk@56670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-05 13:39:28 +00:00
Sergey Biryukov
65bbe06a00 Coding Standards: Add missing escaping in wp-activate.php.
Follow-up to [13884].

Props dilipbheda, mukesh27, pitamdey, nareshbheda.
Fixes #59200.
Built from https://develop.svn.wordpress.org/trunk@57158


git-svn-id: http://core.svn.wordpress.org/trunk@56669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 22:07:27 +00:00
Bernhard Reiter
5e795b65ef Block Hooks: Store ignored hooked blocks metadata in anchor block.
The biggest tradeoff that was made in the implementation of Block Hooks was that they were limited to layouts (i.e. templates, template parts, and patterns) that ''didn't have any user modifications'' (see #59313 for the reason). This changeset is a preparatory step to remove this limitation, so they’ll eventually also work with user-modified layouts.

The crucial problem to solve is how to acknowledge that a user has opted to remove or persist a hooked block, so that the auto-insertion mechanism won't run again and inject an extraneous hooked block on the frontend when none is solicited.

This is achieved by storing all known blocks hooked to a given anchor block in the `metadata` attribute on that anchor block; specifically in a field called `ignoredHookedBlocks` inside of the `metadata`. Hooked blocks are only rendered on the frontend if they're absent from that field; OTOH, they're injected into that field (via the REST API) when first loaded in the editor.

This simple logic guarantees that once a user modifies a given layout, those changes are respected on the frontend; yet if a plugin that includes a hooked block is activated after those modifications have taken place, the hooked block will be rendered on the frontend. This new technique supplants the one previously used (i.e. rendering hooked blocks on the frontend only if a layout doesn't have any modifications) in a rather direct way.

Note that this changeset only introduces the new metadata field and relevant logic; it does not yet enable hooked block insertion into modified layouts. That will be done in a subsequent step (see #59646).

Props gziolo.
Closes #60008.
Built from https://develop.svn.wordpress.org/trunk@57157


git-svn-id: http://core.svn.wordpress.org/trunk@56668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 20:26:22 +00:00
Felix Arntz
04152c0b91 Themes: Clean up inactive themes' theme mods from being autoloaded as part of upcoming 6.5 upgrade routine.
Alongside [57153], this reduces unnecessarily autoloaded data from inactive themes, which can contribute to slow database performance as part of excessive autoloading. This changeset specifically resolves the issue for existing sites.

Props mukesh27, joemcgill, swissspidy, westonruter, flixos90.
Fixes #59975.
See #39537.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 19:51:23 +00:00
Felix Arntz
3a961371dc Themes: Avoid autoloading the previous theme's theme mods when switching to another theme.
This reduces unnecessarily autoloaded data from inactive themes, which can contribute to slow database performance as part of excessive autoloading.

Props mukesh27, rajinsharwar, igmoweb, joemcgill, swissspidy, westonruter, flixos90.
Fixes #59537.
See #59975.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 19:38:22 +00:00
desrosj
65d5985a7c Build/Test Tools: Update the MariaDB test strategy matrix.
This updates the test strategy matrix in the PHPUnit test GitHub Actions workflow to include the most recent MariaDB release, 11.2.

While 11.0 and 11.1 are still maintained, all three are short-term stable releases, which see support dropped after 1 year.

Until a larger discussion around how the project supports database software releases with shorter support windows takes place (short-term in MariaDB or “innovation” releases in MySQL), testing only against the latest short-term release should be sufficient.

Props johnbillion, l1nuxjedi.
See #59806.
Built from https://develop.svn.wordpress.org/trunk@57152


git-svn-id: http://core.svn.wordpress.org/trunk@56663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 18:52:22 +00:00
Aaron Jorbin
b5801411cf Help/About: Change CSS align-item for full browser support.
The values of `start` and `end` are not fully supported by Opera Mini which has 1.01% usage. There is no material change in functionality with this change.

Props kebbet, NekoJonez, luminuu, hellofromTonya.
Fixes #59819.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 18:07:26 +00:00
Sergey Biryukov
42c693e244 Docs: Add missing argument type for supports in register_post_type().
If set to `false`, no feature support is registered for the post type.

Follow-up to [12751], [20734], [29091], [37883].

Props jeremyfelt, swissspidy.
Fixes #59690.
Built from https://develop.svn.wordpress.org/trunk@57150


git-svn-id: http://core.svn.wordpress.org/trunk@56661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-03 20:01:29 +00:00
Sergey Biryukov
e47eb54945 Build/Test Tools: Allow overriding the WP_UnitTestCase_Base::factory() method.
This allows third-party plugins to write their own factory extending `WP_UnitTest_Factory` for testing purposes, as well as benefit from `WP_UnitTestCase_Base` features.

Follow-up to [35186], [35225], [35242].

Props hugod.
Fixes #59999.
Built from https://develop.svn.wordpress.org/trunk@57149


git-svn-id: http://core.svn.wordpress.org/trunk@56660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-02 11:58:27 +00:00
Sergey Biryukov
db7cb1dea2 Upgrade/Install: Add port number to target origin when decrementing update counts.
This ensures that the update counter bubble in the admin menu is properly decreased after a successful plugin or theme update from within the update iframe when the site uses a non-standard port number.

Follow-up to [27280], [29357].

Props TobiasBg.
Fixes #59987.
Built from https://develop.svn.wordpress.org/trunk@57148


git-svn-id: http://core.svn.wordpress.org/trunk@56659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-01 01:35:28 +00:00
hellofromTonya
ea6ccb240c REST API: Restore site logo and icon in index.
Restores setting the site's logo, icon, and wp-admin's back button image (which defaults to W).

Prior to [56566], the site logo and icon were unconditionally added to the index. [56566] changed this by conditionally adding them if either the `_links` or `_embedded` fields were included. However, these fields are not included when using the Site Logo block, as it uses the `site_logo`, `site_icon`, and `site_icon_url` fields instead.

This changeset restores the functionality by checking specifically for the `site_*` fields when neither of the `_links` or `_embedded` fields are present.

Follow up to [56566].

Props antonvlasenko, hellofromTonya, ironprogrammer, priethor, wildworks.
Fixes #59935.
Built from https://develop.svn.wordpress.org/trunk@57147


git-svn-id: http://core.svn.wordpress.org/trunk@56658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-30 14:54:24 +00:00
Sergey Biryukov
26cd5654fe Tests: Update _wp_timezone_choice_usort_callback() tests for consistency.
* Use the same `@group` annotation as the other tests.
* Use `assertSame()` to verify the type of the result.
* Use `data_` prefix for the data provider.
* Use named data set in the data provider. This makes the output when using the `--testdox` option more descriptive and is helpful when trying to debug which data set from a data provider failed the test.
* Other minor corrections.

Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#repetitive-tests Core Handbook: Writing PHP Tests: Repetitive Tests].

Follow-up to [57145].

See #59953, #59647.
Built from https://develop.svn.wordpress.org/trunk@57146


git-svn-id: http://core.svn.wordpress.org/trunk@56657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-30 11:17:27 +00:00
Aaron Jorbin
0a39322193 Add automated tests for _wp_timezone_choice_usort_callback
Props pbearne.
Fixes #59953.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 17:33:21 +00:00
hellofromTonya
064b90c078 Plugins: Fix Add Plugin search button pos when JS off.
When JavaScript is disabled, the Add Plugins screen's search button position was too high in comparison to the search text field. This fix reuses the CSS declaration to keep field and button aligned.

By targeting the `.no-js` class, the CSS specificity is not impacted when JavaScript is enabled.

Follow up to [48281], [30830].

Props devmuhib, sabernhardt, huzaifaalmesbah, hellofromTonya.
Fixes #59967.
Built from https://develop.svn.wordpress.org/trunk@57144


git-svn-id: http://core.svn.wordpress.org/trunk@56655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 16:45:26 +00:00
Pascal Birchler
b7a29ea18c Test: Run database upgrades between performance test steps.
Prevents pending upgrades from blocking tests when checking out previous builds.

Props mukesh27.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57143


git-svn-id: http://core.svn.wordpress.org/trunk@56654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 11:54:23 +00:00
Sergey Biryukov
09c9a0a892 Login and Registration: Use correct variable to display a single error message.
When the `wp_login_errors` filter is used to add an error message followed by an instructional message, the former was not displayed and the latter was errouneously displayed twice above the login form.

This commit ensures that the error message is displayed as expected.

Follow-up to [56654].

Props mapumba.
Fixes #59983.
Built from https://develop.svn.wordpress.org/trunk@57142


git-svn-id: http://core.svn.wordpress.org/trunk@56653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-29 09:34:28 +00:00
Sergey Biryukov
1df0bee7ec Site Health: Remove unused $wpdb global in utf8mb4 support test.
Follow-up to [44984], [56475].

Props upadalavipul, mukesh27.
Fixes #59977.
Built from https://develop.svn.wordpress.org/trunk@57141


git-svn-id: http://core.svn.wordpress.org/trunk@56652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-28 20:24:22 +00:00
John Blackbourn
de91474b4e Docs: Correct the documented type for the block_hooks argument when registering a block type.
This argument is an associative array of strings, not an array of arrays.

See #59313, 59651

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


git-svn-id: http://core.svn.wordpress.org/trunk@56651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-27 20:20:24 +00:00
Sergey Biryukov
2542aabe50 Coding Standards: Reorder conditionals in is_random_header_image().
This aims to slightly improve performance by checking the faster `empty()` language construct first and potentially avoiding an unnecessary function call. Additionally, this better matches a similar conditional a few lines below.

Follow-up to [17757], [17770].

Props Cybr.
See #59650.
Built from https://develop.svn.wordpress.org/trunk@57139


git-svn-id: http://core.svn.wordpress.org/trunk@56650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-27 09:17:21 +00:00
Sergey Biryukov
08d9937eb4 Twenty Twenty-One: Add "blog" and "portfolio" subject tags.
Follow-up to [49216], [49574].

Props sumisubedi, sabernhardt.
Fixes #59495.
Built from https://develop.svn.wordpress.org/trunk@57138


git-svn-id: http://core.svn.wordpress.org/trunk@56649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-27 08:46:28 +00:00
Sergey Biryukov
3fb7d346f3 External Libraries: Upgrade PHPMailer to version 6.9.1.
This is a maintenance and feature release, adding support for the official release of PHP 8.3, methods for removing and replacing custom headers, XCLIENT support, and links to a new way of implementing XOAUTH2 authentication.

The only change likely to have any impact on existing code is that PHPMailer previously attempted to use opportunistic STARTTLS encryption when connecting to `localhost`, which was unlikely to work. The workaround required setting `SMTPAutoTLS = false`, but that's no longer required. You may still need to use this setting when connecting to literal IPs.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.9.1 PHPMailer 6.9.1 release notes]
* [https://github.com/PHPMailer/PHPMailer/compare/v6.8.1...v6.9.1 Full list of changes in PHPMailer 6.9.1]

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937], [55557], [56484].

Props jrf, Synchro.
Fixes #59966.
Built from https://develop.svn.wordpress.org/trunk@57137


git-svn-id: http://core.svn.wordpress.org/trunk@56648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-26 19:27:25 +00:00
Pascal Birchler
eb5c155700 I18N: Improve translator comments for strings containing date formats.
Adds translator comments where absent and changes code style so that
comments are attached to the right strings during string extraction.

Props NekoJonez.
Fixes #59947
Built from https://develop.svn.wordpress.org/trunk@57136


git-svn-id: http://core.svn.wordpress.org/trunk@56647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-26 16:43:30 +00:00
Sergey Biryukov
25a147845b I18N: Move code out of translatable strings in a few error messages.
Follow-up to [54272], [56101].

Props rabmalin, Presskopp.
Fixes #59563.
Built from https://develop.svn.wordpress.org/trunk@57135


git-svn-id: http://core.svn.wordpress.org/trunk@56646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-25 21:19:30 +00:00
Sergey Biryukov
55d1a62ed1 Build/Test Tools: Add a readme note on passing parameters into the PHPUnit tests.
Follow-up to [45745], [47743].

Props pbearne, costdev.
Fixes #59624.
Built from https://develop.svn.wordpress.org/trunk@57134


git-svn-id: http://core.svn.wordpress.org/trunk@56645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-24 14:08:29 +00:00
Sergey Biryukov
9eebad140c Tests: Avoid an infinite loop in Spy_REST_Server if a non-existing method is called.
Follow-up to [34928].

Props xknown, joemcgill.
Fixes #59601.
Built from https://develop.svn.wordpress.org/trunk@57133


git-svn-id: http://core.svn.wordpress.org/trunk@56644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-23 14:41:26 +00:00
desrosj
f275615a0b Build/Test Tools: Run unit tests using new MySQL versions.
The MySQL project has introduced a new versioning strategy with two types of releases: innovation and long-term support. While long-term support is a familiar concept, it’s not clear how innovation releases should be supported in various WordPress versions for a number of reasons.

Mainly, innovation releases are very short-lived. Each one is only supported until the next innovation version is released with a goal of one per quarter. Even though these versions will have a short lifespan they are described as producton-grade and generally available.

More discussion is needed to determine exactly how each WordPress release should support these new innovation releases. But while the parameters for proper support are determined, the PHPUnit tests can be run against these innovation releases to detect any potential problems or incompatibilities.

This change adds the `8.1` and `8.2` innovation releases to the testing matrix for the PHPUnit test worfklow.

Props johnbillion, jorbin.
See #59779.
Built from https://develop.svn.wordpress.org/trunk@57132


git-svn-id: http://core.svn.wordpress.org/trunk@56643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-22 19:40:30 +00:00
Sergey Biryukov
a0504e8091 Text Changes: Update mentions of “web site” to “website” for consistency.
While “web site” was the original spelling, this variant has become rarely used, and “website” is now the standard spelling, already used throughout most of the WordPress core.

Reference: [https://en.wikipedia.org/wiki/Website Wikipedia: Website].

Props LiamMcArthur, cafenoirdesign, sabbirshouvo, sabernhardt, ironprogrammer, mukesh27.
Fixes #59853, #54276.
Built from https://develop.svn.wordpress.org/trunk@57131


git-svn-id: http://core.svn.wordpress.org/trunk@56642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-22 17:44:24 +00:00
Sergey Biryukov
dd3b952a10 General: Rename wp_json_encode() parameters for parity with PHP Core.
`wp_json_encode()` is a wrapper for the PHP native `json_encode()` function with some extra safety checks.

This commit renames the `$data` parameter in the `wp_json_encode()` function and associated functions to `$value`, and the `$options` parameter to `$flags` for parity with the parameter names used in PHP Core.

Reference: [https://www.php.net/manual/en/function.json-encode.php PHP Manual: json_encode()].

Follow-up to [30055].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-21 00:24:20 +00:00
Joe McGill
9b1479bc74 Themes: Remove memoization from stylesheet and theme directories.
This fixes bugs introduced in [56635] whereby the template or stylesheet path could be memoized incorrectly if `get_template_directory()` or `get_stylesheet_directory()` were called before the theme has been fully initialized.

Props partyfrikadelle, coreyw, kdowns, rebasaurus, meta4, flixos90, mukesh27, joemcgill.
Fixes #59847.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-20 22:29:24 +00:00
Sergey Biryukov
2f4ffff0fb Administration: Standardize default values in submit_button().
This commit updates the `submit_button()` function to standardize the default values of `$text` and `$other_attributes` parameters. Previously set to `null`, these defaults have now been changed to an empty string (`''`), bringing consistency with the `get_submit_button()` function, which `submit_button()` wraps.

The change maintains backward compatibility, as `get_submit_button()` does not perform strict type-checking on these parameters. This update aligns with the ongoing effort to standardize function parameters across the WordPress codebase, improving the readability and predictability of the core functions.

Follow-up to [31446].

Props andbalashov.
Fixes #59921.
Built from https://develop.svn.wordpress.org/trunk@57128


git-svn-id: http://core.svn.wordpress.org/trunk@56639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-20 00:08:25 +00:00
Sergey Biryukov
252d94b92d Twenty Twenty-Four: Add missing textdomain in pattern category description.
Follow-up to [56951].

Props gavande1, acosmin, afercia, huzaifaalmesbah, ironprogrammer.
Fixes #59840.
Built from https://develop.svn.wordpress.org/trunk@57127


git-svn-id: http://core.svn.wordpress.org/trunk@56638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-19 11:37:26 +00:00
Sergey Biryukov
c3d10ec052 Code Modernization: Use str_starts_with() in WP_REST_Server::serve_request().
Follow-up to [55703], [56834].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57126


git-svn-id: http://core.svn.wordpress.org/trunk@56637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-18 20:46:28 +00:00
desrosj
79794005b1 Build/Test Tools: Allow the playground-comment job to fail.
When this job fails, it should not fail the entire workflow. The next update to the pull request will attempt to dispatch the commenting workflow.

Follow up to [57124].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 20:11:19 +00:00
desrosj
2a1b659731 Build/Test Tools: Comment on PRs with WordPress Playground information.
After [56958], pull requests to `wordpress-develop` can be tested within a WordPress Playground instance. However this capability is not obvious.

This makes several updates to GitHub action workflows to avoid unnecessary extra runs/jobs while also commenting on pull requests with proper context for testing in Playground once a build is available for the PR.

Changes:
- The `build.yml` workflow has been deleted. The WordPress build process is already being tested within the `test-build-processes.yml` workflow. Now that workflow will produce and upload the built artifact for the given PR.
- A `pull-request-comments.yml` workflow has been added to handle the commenting. To avoid having multiple workflows that comment on PRs, the logic within the `welcome-new-contributors.yml` workflow has been merged into this one.
- The `pull_request` event trigger lacks the needed permission to comment on or update pull requests. Instead of using `pull_request_target` to navigate around this, the `test-build-processes.yml` workflow will now use `workflow_dispatch` to initiate a run of the commenting workflow. This adds the ability to only comment on the PR when a build has been successfully created and uploaded as an artifact.

Props swissspidy, zieladam, jeffpaul.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57124


git-svn-id: http://core.svn.wordpress.org/trunk@56635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 18:24:22 +00:00
Sergey Biryukov
8673b86258 Coding Standards: Rewrite a few capability checks for clarity and readability.
This aims to:
* Perform the checks as early as possible to avoid redundant function calls.
* Remove an empty conditiaonal branch and make the exit conditions clearer.
* Bring the formatting in line with other multi-line conditionals in core.

Follow-up to [56836].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57123


git-svn-id: http://core.svn.wordpress.org/trunk@56634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 17:11:21 +00:00
desrosj
586fab12bf Twenty Twenty-One: Update all dependencies.
In preparation for updating Core to use Node.js version 18.x, this updates the dependancies for the Twenty Twenty-One theme to the latest versions. This addresses an unsupported engine warning where packages within the dependency tree did not support Node.js > 16.x.

All changes to built files are included in this commit. These changes are a result of the following:

- Identical sets of properties for multiple selectors are now consolidated into one.
- The removal of a duplicate `--branding--description--font-family` definition.
- The addition of the `postcss-discard-empty` dependency, which removes empty CSS rules within IE stylesheets after the previous consolidation is performed.
- `stylelint` has only been updated to 14.x (15.x is the latest). This is because `@wordpres/stylelint-config` currently has a version constraint of `^14.2` and does not properly support 15.x.

The last change of note is the new configuration for the `value-keyword-case` rule in `.stylelint-css.json`. This was added as a way to prevent the `currentColor` from being changed to all lowercase.

Props jorbin, poena.
See #59663, #59658.
Built from https://develop.svn.wordpress.org/trunk@57122


git-svn-id: http://core.svn.wordpress.org/trunk@56633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 16:22:19 +00:00
Sergey Biryukov
09815e007d Docs: Fix typo in get_image_tag() DocBlock.
Follow-up to [54173].

Props kitchin.
See #55646, #59651.
Built from https://develop.svn.wordpress.org/trunk@57121


git-svn-id: http://core.svn.wordpress.org/trunk@56632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 15:33:21 +00:00
Sergey Biryukov
d7a1816bf1 Docs: Improve some DocBlocks and inline comments per the documentation standards.
Follow-up to [56834], [56836], [56837], [56838].

Props kebbet, costdev, mukesh27, SergeyBiryukov.
See #59651.
Built from https://develop.svn.wordpress.org/trunk@57120


git-svn-id: http://core.svn.wordpress.org/trunk@56631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 13:29:26 +00:00
Bernhard Reiter
382c01d848 Block Hooks: Expose serialized template content to filter.
The recently introduced Block Hooks API exposes a filter (`hooked_block_types`) which is given a `$context` argument, among others. If the filter is called on a block that's part of a template or template part, `$context` is set to the corresponding `WP_Block_Template` object.

However, that object's `$content` property is currently ''not'' exposed to the filter. This changeset amends that shortcoming.

This is useful for callbacks that might want to detect the presence of a serialized block instance (or potentially in the future utilize the HTML API) to restrict where the block is injected (before the template is rendered).

Addressing this also achieves parity with the structure of `$context` when it represents a pattern (where pattern serialized content is present).

Props nerrad.
Fixes #59882.
Built from https://develop.svn.wordpress.org/trunk@57118


git-svn-id: http://core.svn.wordpress.org/trunk@56629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 07:10:21 +00:00
Bernhard Reiter
b5ac702f60 HTML API: Fix typo in documentation example.
The example code in the PHPDoc comment for the HTML Tag Processor class
previously showed calling `next_tag()` with an array containing a `class`
key, which should have been `class_name`. This patch fixes this by using
the appropriate `class_name` key.

Props dmsnell, gaambo, crstauf, atachibana, audrasjb, krupalpanchal.
Fixes #59891.
Built from https://develop.svn.wordpress.org/trunk@57116


git-svn-id: http://core.svn.wordpress.org/trunk@56627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 06:40:24 +00:00
Bernhard Reiter
b86334b447 HTML API: Add support for containers elements, including ARTICLE.
There are a handful of elements which behave similarly and are generically container elements. These are the following elements:

    ADDRESS, ARTICLE, ASIDE, BLOCKQUOTE, CENTER, DETAILS, DIALOG, DIR,
    DL, DIV, FIELDSET, FIGCAPTION, FIGURE, FOOTER, HEADER, HGROUP, MAIN,
    MENU, NAV, SEARCH, SECTION, SUMMARY

This patch adds support to the HTML Processor for handling these elements. They do not require any additional logic in the rest of the class, and carry no specific semantic rules for parsing beyond what is listed in their group in the IN BODY section of the HTML5 specification.

Props dmsnell.
Fixes #59914.
Built from https://develop.svn.wordpress.org/trunk@57115


git-svn-id: http://core.svn.wordpress.org/trunk@56626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 06:13:25 +00:00
Sergey Biryukov
222813317f Docs: Replace tabindex example in submit button functions documentation.
Most of the `tabindex` attributes across the admin were removed in [21311].

This commit updates the example for the `$other_attributes` parameter to use the `id` attribute instead.

Includes synchronizing documentation between `submit_button()` and `get_submit_button()`.

Follow-up to [15810], [16061], [21311], [27136], [31599].

Props benjaminknox, sabernhardt, fushar, SergeyBiryukov.
Fixes #59768.
Built from https://develop.svn.wordpress.org/trunk@57114


git-svn-id: http://core.svn.wordpress.org/trunk@56625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-16 17:02:25 +00:00
Sergey Biryukov
812b1e296c Docs: Fix typo in the ms_user_list_site_class filter description.
Follow-up to [44977].

Props nithins53, shailu25, sabernhardt.
Fixes #59907.
Built from https://develop.svn.wordpress.org/trunk@57111


git-svn-id: http://core.svn.wordpress.org/trunk@56622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-15 09:33:26 +00:00
Sergey Biryukov
91334ba3ab Docs: Use typed array notation for the $options parameter in some new functions.
Follow-up to [56445], [56508], [57013].

Props tmatsuur.
Fixes #59904.
Built from https://develop.svn.wordpress.org/trunk@57110


git-svn-id: http://core.svn.wordpress.org/trunk@56621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-14 12:44:27 +00:00
isabel_brison
078ed1a3a6 Editor: update npm packages for 6.4.2.
Package updates with bug fixes related to patterns, Query look interactivity, design tools UI and accessibility.

Props mikachan, jorbin, kebbet, artemiosans, talldanwp, ramonopoly, alexstine, andrewserong, mamaduka, cbravobernal, ajlende, luisherranz.
See #59828.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-14 00:12:23 +00:00
Sergey Biryukov
f3a843e952 Docs: Replace miscellaneous incorrect PHPDoc tags.
* `@contrib` is not a valid tag.
* `@origin` is not a valid tag.
* `@ref` is not a valid tag.
* `@blessed` is not a valid tag and doesn't convey any meaningful information.
* `@issue` is not a valid tag.

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#phpdoc-tags PHP Documentation Standards: PHPDoc Tags].

Follow-up to [8852], [34754], [38832], [43808].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-13 11:13:27 +00:00
Sergey Biryukov
b2dcecf188 Docs: Fix incorrect property doc in WP_Theme::get_allowed() tests.
The `@array` tag does not exist. This should be `@var array`.

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#2-1-class-members PHP Documentation Standards: Class Members].

Follow-up to [36350].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-12 09:21:24 +00:00
Sergey Biryukov
5896701b31 Docs: Include 'weekly' as a valid value in wp_schedule_event() description.
Follow-up to [47062].

Props crstauf, pacicio.
Fixes #59888.
Built from https://develop.svn.wordpress.org/trunk@57106


git-svn-id: http://core.svn.wordpress.org/trunk@56617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-11 09:28:30 +00:00
Sergey Biryukov
7a0036e448 Docs: Fix broken @covers tag in _wp_post_thumbnail_context_filter() tests.
Without the space between the tag and the "description", the tag will not be recognized and the test will not record coverage correctly.

Reference: [https://docs.phpunit.de/en/9.6/annotations.html#covers PHPUnit Manual: Annotations].

Follow-up to [55821].

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


git-svn-id: http://core.svn.wordpress.org/trunk@56616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-10 22:54:27 +00:00
Felix Arntz
50aa8fc45d Tests: Fix incorrect check for block themes in legacy PHPUnit test for themes.
Props mukesh27.
Fixes #59881.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-10 19:01:27 +00:00
Joe McGill
832dd52ade Themes: Correct docblock for _register_theme_block_patterns.
This updates the '@since 6.4.0' annotation in `_register_theme_block_patterns` to reference `WP_Theme::get_block_patterns` instead of `_wp_get_block_patterns`, which was changed in [56978].

Props audrasjb, mukesh27, joemcgill.
Fixes #59869.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-10 15:12:27 +00:00