Contributing to WordPress using `wordpress-develop` on GitHub is a useful way collaborate, test, and review suggested changes to the code base. One of the required criteria, though, is including a link to a corresponding Trac ticket. This ensures the PR and associated activity is listed on the Trac ticket, which serves as the source of truth.
It’s easy to forget this and newer contributors aren’t always aware of this requirement. This adds a GitHub Actions job that will add a comment as a reminder when no Trac ticket is included.
Is the waiting really ended? Two thousand years.
Props anamarijapapic, peterwilsoncc.
Fixes#60129.
Built from https://develop.svn.wordpress.org/trunk@58092
git-svn-id: http://core.svn.wordpress.org/trunk@57557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Plugin activation on the Plugins > Add New screen is performed using AJAX, no longer performing redirects. This means that users will not see a newly activated plugin's menu items, admin notices, or other UI elements until the user refreshes or navigates to another screen. Without adequate messaging and direction, users may be unsure of what to do next.
This shows an admin notice when a plugin is activated from its plugin card or modal, informing the user that the plugin was activated, and that some changes may not occur until they refresh the page.
Follow-up to [57545].
Props costdev, jorbin, jeherve, flixos90, joedolson, ironprogrammer, audrasjb, alanfuller, kevinwhoffman, devsahadat, afragen, adrianduffell, azaozz, jason_the_adams, JeffPaul, webdevmattcrom, DrewAPicture, justlevine, stevejonesdev, benlk, roytanck.
Fixes#60992. See #22316.
Built from https://develop.svn.wordpress.org/trunk@58081
git-svn-id: http://core.svn.wordpress.org/trunk@57546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This prevents a number of php notices that are surfaced due to the endpoint being called on load of the post editor even when there are no templates.
Props grantmkin, CookiesForDevo, britner, wildworks, jorbin.
Fixes#60909.
Built from https://develop.svn.wordpress.org/trunk@58079
git-svn-id: http://core.svn.wordpress.org/trunk@57544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Simplifies the tests setup by leveraging a test matrix, improving maintenance and making it much easier to test more scenarios. With this change, tests are now also run with an external object cache (Memcached). Additional information such as memory usage and the number of database queries is now collected as well.
Improves test setup and cleanup by disabling external HTTP requests and cron for the tests, as well as deleting expired transients and flushing the cache in-between. This should aid the test stability.
When testing the previous commit / target branch, this now leverages the already built artifact from the build process workflow. Raw test results are now also uploaded as artifacts to aid debugging.
Props swissspidy, adamsilverstein, joemcgill, mukesh27, desrosj, youknowriad, flixos90.
Fixes#59900
Built from https://develop.svn.wordpress.org/trunk@58076
git-svn-id: http://core.svn.wordpress.org/trunk@57541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The html5lib-tests suite parses tests from a number of files with a specific
data format. It uses a dataProvider in a loop that yields test information.
This relies on some variables being reset on each iteration. The context
element has not properly reset on each iteration.
The test specification describes the context element as follows:
a9f44960a9/tree-construction/README.md
> Then there *may* be a line that says "#document-fragment", which must be
> followed by a newline (LF), followed by a string of characters that indicates
> the context element, followed by a newline (LF). If the string of characters
> starts with "svg ", the context element is in the SVG namespace and the
> substring after "svg " is the local name. If the string of characters starts
> with "math ", the context element is in the MathML namespace and the
> substring after "math " is the local name. Otherwise, the context element is
> in the HTML namespace and the string is the local name. If this line is
> present the "#data" must be parsed using the HTML fragment parsing algorithm
> with the context element as context.
Without the proper reset of this value, a single context element would change
subsequent tests, breaking the test suite.
This patch adds the reset to ensure that the test suite works properly.
Developed in https://github.com/WordPress/wordpress-develop/pull/6464
Discussed in https://core.trac.wordpress.org/ticket/61102Fixes#61102.
Props costdev, dmsnell, jonsurrell.
Built from https://develop.svn.wordpress.org/trunk@58072
git-svn-id: http://core.svn.wordpress.org/trunk@57537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [36444].
Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58070
git-svn-id: http://core.svn.wordpress.org/trunk@57535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The way `wp_reset_vars()` sets global variables based on `$_POST` and `$_GET` values makes code hard to understand and maintain. It also makes it easy to forget to sanitize input.
This change removes the few places where `wp_reset_vars()` is used in the admin to explicitly use `$_REQUEST` and sanitize any input.
Props swissspidy, audrasjb, davideferre, killua99, weijland, voldemortensen.
Fixes#38073.
Built from https://develop.svn.wordpress.org/trunk@58069
git-svn-id: http://core.svn.wordpress.org/trunk@57534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Before, `wp_localize_script()` did not work when the `$wp_scripts` global was not already set (for example because of a script registration happening elsewhere) and even emitted a warning in that case. Due to side effects such as block registration early in the load process, this usually never happened. However, the absence of these side effects in 6.5 caused the `wp_localize_script()` to no longer work in places such as the `login_enqueue_scripts`.
By calling `wp_scripts()` in `wp_localize_script()`, the `$wp_scripts` global is automatically set if needed, restoring previous behavior. Adds both a PHP unit test and an e2e test to verify this use case. Hat tip: jorbin.
Happy birthday, Aaron!
Props salcode, aslamdoctor, jorbin, swissspidy.
Fixes#60862.
Built from https://develop.svn.wordpress.org/trunk@58068
git-svn-id: http://core.svn.wordpress.org/trunk@57533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This can be used by the excerpt block in the editor to change the excerpt length without filtering `excerpt_length` in a conflicting way. This enhancement still needs a corresponding change on the Gutenberg side.
Props swissspidy, antonvlasenko, mukesh27, azaozz, andraganescu, timothyblynjacobs.
Fixes#59043.
Built from https://develop.svn.wordpress.org/trunk@58065
git-svn-id: http://core.svn.wordpress.org/trunk@57530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Moves the translatable strings from the JS template defined in PHP to the `updates.js` script, where `_n()` can be used as recommended.
Props ideag, SergeyBiryukov, daledupreez, audrasjb, ocean90, swissspidy.
Fixes#37287.
Built from https://develop.svn.wordpress.org/trunk@58064
git-svn-id: http://core.svn.wordpress.org/trunk@57529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improve support for using only PHP translation files.
This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely `.l10n.php` translation files and no `.mo.` and `.po` files.
Updates `wp_get_installed_translations()`, which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using `WP_Textdomain_Registry`.
Updates `Language_Pack_Upgrader::check_package()` to allow language packs that only contain PHP translation files. While WordPress.org continues to serve `.mo` and `.po` files, third-party services might want to only use the PHP file format.
See #60554.
Built from https://develop.svn.wordpress.org/trunk@58062
git-svn-id: http://core.svn.wordpress.org/trunk@57527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely `.l10n.php` translation files and no `.mo.` and `.po` files.
Updates `wp_get_installed_translations()`, which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using `WP_Textdomain_Registry`.
Updates `Language_Pack_Upgrader::check_package()` to allow language packs that only contain PHP translation files. While WordPress.org continues to serve `.mo` and `.po` files, third-party services might want to only use the PHP file format.
Props swissspidy.
Fixes#60554.
Built from https://develop.svn.wordpress.org/trunk@58061
git-svn-id: http://core.svn.wordpress.org/trunk@57526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[56950] reduced the heading size of About screen headings, but that did not edit the size for smaller viewports.
This changeset fixes this issue, and also updates the larger fluid font size (960px - 1200px).
Follow-up to [56950].
Props dhruvang21, sabernhardt, khokansardar.
Fixes#61030.
Built from https://develop.svn.wordpress.org/trunk@58060
git-svn-id: http://core.svn.wordpress.org/trunk@57525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [38381].
Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58054
git-svn-id: http://core.svn.wordpress.org/trunk@57519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The pullquote block needed the base font size adding back in. This also adds in support for appearance settings for weight and style in addition to the original ticket. This fixes a previous commit which changed the default font size of pullquote blocks, quote blocks and blockquotes.
Props sabernhardt.
Fixes#61034.
Built from https://develop.svn.wordpress.org/trunk@58053
git-svn-id: http://core.svn.wordpress.org/trunk@57518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [38778], [46829].
Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58052
git-svn-id: http://core.svn.wordpress.org/trunk@57517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Follow-up to [34928], [51478], [58039].
See #60426.
Built from https://develop.svn.wordpress.org/trunk@58051
git-svn-id: http://core.svn.wordpress.org/trunk@57516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The purpose of `tests/e2e/specs/gutenberg-plugin.test.js` is to ensure that running the Gutenberg plugin (stable version) on a WordPress `trunk` install doesn't produce any fatals.
The test was introduced in [54913], i.e. it has been around since WP 6.2. It makes sense to have it present on older branches, as the Gutenberg plugin not only supports `trunk`, but also the current stable version of WordPress (i.e. currently 6.5), and one version below (6.4). However, it is not expected to work on any earlier versions beyond that; in practice, it has produced errors on some of those.
This changeset checks the REST API response from the plugin activation request. If it returns an error with error code `plugin_wp_incompatible`, it skips the test.
Props jorbin, johnbillion, swissspidy.
Fixes#60971.
Built from https://develop.svn.wordpress.org/trunk@58046
git-svn-id: http://core.svn.wordpress.org/trunk@57512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [41047].
Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58044
git-svn-id: http://core.svn.wordpress.org/trunk@57510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Two `@since` PHPDoc fields, and the version argument to one `_deprecated_argument()` incorrectly stated 6.5.1 as the relevant WordPress version where a change was introduced.
This changeset fixes them by setting them to 6.5.3 instead.
Follow-up to [57919].
See #60754.
Built from https://develop.svn.wordpress.org/trunk@58042
git-svn-id: http://core.svn.wordpress.org/trunk@57508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since [60428] the Tag Processor has been misidentifying single-character
funky comments. It has been asserting that the full token-length for a
funky comment must be at least three characters after the opening (e.g.
`</1>`), but it has been starting to look for the closing `>` after
those same three characters. This means that it has been skipping the
actual close of these funky comments and swallowing up the next syntax
until it finds a `>`, often consuming the next tag in the process.
This patch fixes the detector and restores finding the following token.
Developed in https://github.com/WordPress/wordpress-develop/pull/6412
Discussed in https://core.trac.wordpress.org/ticket/60170
Follow-up to [60428].
Fixes#60170.
Props dmsnell, gziolo, jonsurrell.
Built from https://develop.svn.wordpress.org/trunk@58040
git-svn-id: http://core.svn.wordpress.org/trunk@57506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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 `WP_Test_REST_TestCase::assertErrorResponse()`.
Follow-up to [34928], [51478].
Props mykolashlyakhtun, antonvlasenko, swissspidy, SergeyBiryukov.
Fixes#60426.
Built from https://develop.svn.wordpress.org/trunk@58039
git-svn-id: http://core.svn.wordpress.org/trunk@57505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changesets replaces the "Edit Site" link with "Site Editor" to avoid duplicate link anchors on multisite admin toolbar. The remaining "Edit site" link takes the user to the site editing screen in the network admin area (`network/site-info.php`) while the new "Site Editor" link takes the user to the site editor (`site-editor.php`).
Follow-up to [52158]. See GB27135.
Props johnbillion, sabernhardt, audrasjb, johnjamesjacoby, pratiklondhe.
Fixes#60977.
Built from https://develop.svn.wordpress.org/trunk@58035
git-svn-id: http://core.svn.wordpress.org/trunk@57501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This extends the benefits of persistent caching added in [56978] for block theme patterns to sites that are not using a persistent object cache. By default, these caches expire using the value of the `WP_Theme::cache_expiration` property. The transient cache TTL can be overridden using the newly introduced `wp_theme_files_cache_ttl` filter.
Props thekt12, joemcgill, flixos90, peterwilsoncc, spacedmonkey.
See #59600, #59719.
Built from https://develop.svn.wordpress.org/trunk@58025
git-svn-id: http://core.svn.wordpress.org/trunk@57491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Remove `target="_blank"` from two links to developer resources on adding the personal data eraser to plugins in the Help info for the privacy screens. Also rectifies differences between the export and erase text for consistency and changes the order of paragraphs.
Props sabernhardt, joedolson.
Fixes#60097.
Built from https://develop.svn.wordpress.org/trunk@58021
git-svn-id: http://core.svn.wordpress.org/trunk@57487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This matches the type expected by the `setcookie()` function for the `$domain` parameter, and resolves a fatal error if `strict_types` is enabled.
Reference: [https://www.php.net/setcookie PHP Manual: setcookie()].
Follow-up to [2725], [6434], [12732], [13062].
Props kmvan, rajinsharwar, jrf, desrosj, Cybr, nicolefurlan, oglekler, hellofromTonya, kirasong, chaion07, mukesh27.
Fixes#46550.
Built from https://develop.svn.wordpress.org/trunk@58011
git-svn-id: http://core.svn.wordpress.org/trunk@57482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In this patch, the test suite from html5lib validates the tree-construction
steps in the HTML Processor to ensure that they are behaving according to the
HTML specification. This suite of tests is also used by the servo project to
test its html5ever package.
A new test module in the HTML API transforms HTML Processor output to match
the expected tree shape from the external tests. For cases where there are
tests validating behaviors of unsupported HTML tags and constructs, the tests
are marked as skipped. As the HTML API continues to expand its own support,
the number of skipped tests will automatically shrink down towards zero.
Additional tests are skipped through the `SKIP_TEST` array in the test runner.
Fixes#60227.
See #58517.
Props azaozz, costdev, dmsnell, hellofromtonya, jonsurrell, jorbin, swisspidy.
Built from https://develop.svn.wordpress.org/trunk@58010
git-svn-id: http://core.svn.wordpress.org/trunk@57481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In PHP 8.4, declaring function or method parameters with a default value of `null` is deprecated if the type is not nullable.
PHP applications are recommended to ''explicitly'' declare the type as nullable. All type declarations that have a default value of `null`, but without declaring `null` in the type declaration, will emit a deprecation notice:
{{{
function test( array $value = null ) {}
}}}
`Deprecated: Implicitly marking parameter $value as nullable is deprecated, the explicit nullable type must be used instead`
**Recommended Changes**
Change the implicit nullable type declaration to a nullable type declaration, available since PHP 7.1:
{{{#!diff
- function test( string $test = null ) {}
+ function test( ?string $test = null ) {}
}}}
This commit updates the affected instances in core to use a nullable type declaration.
References:
* [https://wiki.php.net/rfc/deprecate-implicitly-nullable-types PHP RFC: Deprecate implicitly nullable parameter types]
* [https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated PHP.Watch: PHP 8.4: Implicitly nullable parameter declarations deprecated]
Follow-up to [28731], [50552], [57337], [57985].
Props ayeshrajans, jrf, audrasjb, jorbin.
Fixes#60786.
Built from https://develop.svn.wordpress.org/trunk@58009
git-svn-id: http://core.svn.wordpress.org/trunk@57480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes the issue where negative values aren't allows in older versions of IE. There is more discussion in another ticket on a wider approach, but for now the decision to commit this was made as an interim solution.
Props mukesh27, SergeyBiryukov, sabernhardt, poena.
Fixes#46771.
Built from https://develop.svn.wordpress.org/trunk@58005
git-svn-id: http://core.svn.wordpress.org/trunk@57479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While technically only `null`, `WP_User`, or `WP_Error` should be returned from the `authenticate` filter, a plugin might return boolean `false` instead, which would trigger the `authentication_failed` error prior to [57882].
This commit aims to preserve that behavior in case `false` is returned.
Follow-up to [57882].
Props johnbillion.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57990
git-svn-id: http://core.svn.wordpress.org/trunk@57476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Stop enqueueing polyfills such as `wp-polyfill-inert` (for the `inert` attribute) and `regenerator-runtime` (for generator functions), as they are no longer needed, considering the WordPress project's [https://make.wordpress.org/core/handbook/best-practices/browser-support/ browser support policy].
In addition to that, `wp-polyfill` (essentially `core-js`) is no longer enqueued as a dependency of `react`. This was added in [43903] to ensure compatibility with IE 11, which is no longer supported by WordPress. Developers requiring `wp-polyfill` need to manually add it as a dependency for their scripts.
Props swissspidy, flixos90, adamsilverstein, youknowriad, gziolo.
Fixes#60962.
Built from https://develop.svn.wordpress.org/trunk@57981
git-svn-id: http://core.svn.wordpress.org/trunk@57467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Currently, in blocks themes it's possible to use the ${type}_template_hierarchy filter to alter the template hierarchy. However, those filters are not taken into consideration by the Choose a pattern popup screen that appears when creating a new template in the Site Editor, causing a mismatch between the editor and the frontend.
Props aljullu, mukesh27, ntsekouras, jorgefilipecosta, gziolo.
Fixes#60846.
Built from https://develop.svn.wordpress.org/trunk@57944
git-svn-id: http://core.svn.wordpress.org/trunk@57441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Include the asset version of JavaScript and CSS files when generating the ETag for concatenated assets in `load-scripts.php` and `load-styles.php`. This ensures the ETag is updated as script versions change (for example editor package updates) rather than only when the WordPress version changes.
The `W\` prefix is added to the generated ETag to allow for CDNs and proxy servers modifying the script to add or improve the compression algorithm.
Props azaozz, dav4, ironprogrammer, johnbillion, kkmuffme, monzuralam, peterwilsoncc, sergeybiryukov.
Fixes#58433.
Built from https://develop.svn.wordpress.org/trunk@57943
git-svn-id: http://core.svn.wordpress.org/trunk@57440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The value of `start` is not fully supported by Opera Mini which has 1.01% usage. There is no material change in functionality with this change.
Follow-up to [55919].
Props davidbaumwald, sabernhardt, khokansardar, devsahadat.
Fixes#60876.
Built from https://develop.svn.wordpress.org/trunk@57933
git-svn-id: http://core.svn.wordpress.org/trunk@57434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.
This commit aims to make the affected tests more reliable.
Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].
Props peterwilsoncc, jorbin.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57931
git-svn-id: http://core.svn.wordpress.org/trunk@57432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds an `is_dir()` check in `_get_block_templates_paths` before trying to run a `RecursiveDirectoryIterator` to avoid errors being reported in New Relic even thought the errors should be handled by a try/catch block.
Follow-up to [57215].
Props iCaleb, sean212, mukesh27, joemcgill.
Fixes#60915.
Built from https://develop.svn.wordpress.org/trunk@57928
git-svn-id: http://core.svn.wordpress.org/trunk@57429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since WordPress 6.5, the minimum supported version of MySQL and MariaDB is 5.5.5. This means all supported database servers now support the `utf8mb4` character set and therefore the conditional logic for this is no longer necessary.
Props l1nuxjedi, craigfrancis, OllieJones, johnbillion
Fixes#60096
Built from https://develop.svn.wordpress.org/trunk@57926
git-svn-id: http://core.svn.wordpress.org/trunk@57427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Some plugins pass invalid values such as `null` instead of a string, which has never been supported by WordPress (no translations are loaded) and was technically undefined behavior. With the introduction of the new l10n library in #59656, which has stricter type hints, this could end up causing warnings or even fatal errors.
This change adds a deliberate short-circuit to `load_textdomain()` & co. to better handle such a case and document that it is not supported.
Props verygoode, swissspidy.
Fixes#60888.
Built from https://develop.svn.wordpress.org/trunk@57925
git-svn-id: http://core.svn.wordpress.org/trunk@57426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow-up to #60865 / [57903] where similar instances were recently updated due to an upstream change.
Particularly the `test_wp_crop_image_with_url()` test recently began to fail on some environments, likely because of the same change.
This updates the image URLs with the aim to bring more consistency and to get the test passing again more broadly.
Fixes#60907.
Built from https://develop.svn.wordpress.org/trunk@57924
git-svn-id: http://core.svn.wordpress.org/trunk@57425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, when `WP_PLUGIN_DIR` was set to something other than `wp-content/plugins`, e.g. `wp-content/mods`, `load_script_textdomain` was searching for script translations in `wp-content/languages/mods`. However, that is incorrect, as `WP_PLUGIN_DIR` does not affect where translations are stored. The location is always `wp-content/languages/plugins`.
Props coreymckrill, swissspidy.
Fixes#60891.
Built from https://develop.svn.wordpress.org/trunk@57922
git-svn-id: http://core.svn.wordpress.org/trunk@57423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
An excessive amount of autoloaded options is a common cause for slow database responses, sometimes caused by very large individual autoloaded options. As it is not mandatory to provide an autoload value when adding an option to the database, it tends to be ignored, which in combination with a default value of "yes" and lack of documentation can lead to the aforementioned problem.
This changeset enhances the option autoloading behavior in several ways:
* Update the function documentation to encourage the use of boolean `true` or `false` to explicitly provide an autoload value for an option.
* Use new string values `on` and `off` for explicitly provided values stored in the database, to distinguish them from `yes` and `no`, since `yes` does not allow determining whether it was set intentionally by the developer or only as a default.
* Effectively deprecate the values `yes` and `no`. They are still supported for backward compatibility, but now discouraged.
* Use `null` as new default autoload value for `add_option()`. If the developer does not provide an explicit value, this will now trigger WordPress logic to determine an autoload value to use:
* If WordPress determines that the option should not be autoloaded, it is stored in the database as `auto-off`. As part of this changeset, the single heuristic introduced for that is to check whether the option size is larger than a threshold of 150k bytes. This threshold is filterable via a new `wp_max_autoloaded_option_size` filter.
* If WordPress determines that the option should be autoloaded, it is stored in the database as `auto-on`. No logic to make such a decision is introduced as part of this changeset, but a new filter `wp_default_autoload_value` can be used to define such heuristics, e.g. by optimization plugins.
* If WordPress cannot determine whether or not to autoload the option, it is stored in the database as `auto`.
* This effectively means that any option without an explicit autoload value provided by the developer will be stored with an autoload value of `auto`, unless the option's size exceeds the aforementioned threshold. Options with a value of `auto` are still autoloaded as of today, most importantly for backward compatibility. A new function `wp_autoload_values_to_autoload()` returns the list of autolaod values that dictate for an option to be autoloaded, and a new filter `wp_autoload_values_to_autoload` can be used to alter that list.
These behavioral changes encourage developers to be more mindful of autoloading, while providing WordPress core and optimization plugins with additional control over heuristics for autoloading options where no explicit autoload value was provided.
At the same time, the changes are fully backward compatible from a functionality perspective, with the only exception being that very large options will now no longer be autoloaded if the developer did not explicitly request for them to be autoloaded. Neither WordPress core nor plugins are able to override an explicitly provided value, which is intentional to continue giving developers full control over their own options.
Props pbearne, flixos90, joemcgill, azaozz, spacedmonkey, swissspidy, mukesh27, markjaquith.
Fixes#42441.
Built from https://develop.svn.wordpress.org/trunk@57920
git-svn-id: http://core.svn.wordpress.org/trunk@57421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `$context` argument passed to filters such as `hooked_block_types`, `hooked_block`, and `hooked_block_{$hooked_block_type}` allows them to conditionally insert a hooked block. If the anchor block is contained in a template or template part, `$context` will be set to a `WP_Block_Template` object reflecting that template or part.
The aforementioned filters are applied when hooked block insertion is run upon reading a template (or part) from the DB (and before sending the template/part content with hooked blocks inserted over the REST API to the client), but also upon writing to the DB, as that's when the `ignoredHookedBlocks` metadata attribute is set.
Prior to this changeset, the `$context` passed to Block Hooks related filters in the latter case reflected the template/part that was already stored in the database (if any), which is a bug; instead, it needs to reflect the template/part that will result from the incoming `POST` network request that will trigger a database update.
Those incoming changes are encapsulated in the `$changes` argument passed to the `reset_pre_insert_template` and `reset_pre_insert_template_part` filters, respectively, and thus to the `inject_ignored_hooked_blocks_metadata_attributes` function that is hooked to them. `$changes` is of type `stdClass` and only contains the fields that need to be updated. That means that in order to create a `WP_Block_Template` object, a two-step process is needed:
- Emulate what the updated `wp_template` or `wp_template_part` post object in the database will look like by merging `$changes` on top of the existing `$post` object fetched from the DB, or from the theme's block template (part) file, if any.
- Create a `WP_Block_Template` from the resulting object.
To achieve the latter, a new helper method (`_build_block_template_object_from_post_object`) is extracted from the existing `_build_block_template_result_from_post` function. (The latter cannot be used directly as it includes a few database calls that will fail if no post object for the template has existed yet in the database.)
While somewhat complicated to implement, the overall change allows for better separation of concerns and isolation of entities. This is visible e.g. in the fact that `inject_ignored_hooked_blocks_metadata_attributes` no longer requires a `$request` argument, which is reflected by unit tests no longer needing to create a `$request` object to pass to it, thus decoupling the function from the templates endpoint controller.
Unit tests for `inject_ignored_hooked_blocks_metadata_attributes` have been moved to a new, separate file. Test coverage has been added such that now, all three relevant scenarios are covered:
- The template doesn't exist in the DB, nor is there a block theme template file for it.
- The template doesn't exist in the DB, but there is a block theme template file for it.
- The template already exists in the DB.
Those scenarios also correspond to the logical branching inside `WP_REST_Templates_Controller::prepare_item_for_database`, which is where `inject_ignored_hooked_blocks_metadata_attributes` gets its data from.
Props tomjcafferkey, bernhard-reiter, gziolo, swissspidy.
Fixes#60754.
Built from https://develop.svn.wordpress.org/trunk@57919
git-svn-id: http://core.svn.wordpress.org/trunk@57420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Compose V2, which was first released in 2020, is included with all currently supported versions of Docker Desktop. Compose V1 stopped receiving updates in July 2023.
The biggest difference is that the command to interact with Compose changed from `docker-compose` to `docker compose`.
GitHub has now started removing V1 from Ubuntu & Windows images, which caused all Docker-based GitHub Actions workflows to fail.
This change migrates to the new `docker compose` command to address these failures.
Props swissspidy, thelovekesh.
Fixes#60901.
Built from https://develop.svn.wordpress.org/trunk@57918
git-svn-id: http://core.svn.wordpress.org/trunk@57419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.
This commit uses a direct file URL and updates the expected image size to match the currently returned response.
Follow-up to [139/tests], [31258], [47142].
Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57903
git-svn-id: http://core.svn.wordpress.org/trunk@57404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The pullquote block wasn't reflecting text color added for quote and add citation text across the front and back of editor. This fixes that by adding ensuring whatever color is selected is shown in both
Props kajalgohel.
Fixes#56524.
Built from https://develop.svn.wordpress.org/trunk@57896
git-svn-id: http://core.svn.wordpress.org/trunk@57397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There wasn't enough padding and the spacing was deteriorating the more depth there was. This reflects the front now and respects background coloring. Impacts both types of lists although original reporting was just on one.
Props aezazshekh, krupalpanchal, multidots1896, kajalgohel, sabernhardt.
Fixes#56083.
Built from https://develop.svn.wordpress.org/trunk@57895
git-svn-id: http://core.svn.wordpress.org/trunk@57396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset put back the context parameter of the "Patterns" string which was previously removed to fix a translation issue without introducing a string change during WP 6.5 string freeze period.
Follow-up to [57864].
Props kebbet, narenin, nestea29950.
Fixes#60827.
Built from https://develop.svn.wordpress.org/trunk@57887
git-svn-id: http://core.svn.wordpress.org/trunk@57388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
With this change default shadow presets are never shown for classic themes, and classic themes have no options for adding custom ones.
This essentially reverts [57717] and [57827] / [57828], which had unintended consequences.
Props ajlende, oandregal, madhudollu, swissspidy, get_dave, andrewserong, desrosj.
Fixes#60815.
Built from https://develop.svn.wordpress.org/trunk@57885
git-svn-id: http://core.svn.wordpress.org/trunk@57386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Relocate the upload of font files uploaded via the Font Library feature to the `wp-content/uploads/fonts` (or multisite equivalent) directory.
This accounts for immutable file systems in which directories are unable to be created within `wp-content` and deploy processes which require special consideration of the `uploads` directory to ensure it remains persistent between deploys.
Props azaozz, burnuser, cbirdsong, christopherplus, costdev, davidbaumwald, desrosj, elrae, euthelup, get_dave, grantmkin, hellofromtonya, janthiel, jazzs3quence, johnbillion, jorbin, justlevine, kraftner, matveb, mcsf, mmaattiiaass, nico23, peterwilsoncc, priethor, rmccue, samuelsidler, swissspidy, youknowriad.
Fixes#60845.
Built from https://develop.svn.wordpress.org/trunk@57878
git-svn-id: http://core.svn.wordpress.org/trunk@57379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This modifies the font directory API to more closely reflect the upload directory API to help account for naive filtering when uploading fonts.
This moves the protection of infinite loops to the new function `_wp_filter_font_directory()` to allow developers extending and maintaining the font library to apply the filter without the need for a closure.
These changes also ensure both the `upload_dir` and `font_dir` filter are applied consistently when both creating and deleting fonts faces. Prior to this commit the `upload_dir` filter was only fired when creating fonts faces via the REST API.
Applying the font directory filter to the `upload_dir` filter is now done by adding the `_wp_filter_font_directory` function rather than `wp_get_font_dir()`. Developers who have previously modified the font upload directory using the `font_dir` filter will NOT need to upload their code.
Extenders wishing to upload files to the font directory can do so via the code:
{{{#!php
<?php
add_filter( 'upload_dir', '_wp_filter_font_directory' );
// Your code to upload or sideload a font file.
remove_filter( 'upload_dir', '_wp_filter_font_directory' );
}}}
Introduces:
* `wp_font_dir()`: Attempt to create and retrieve the font upload directory. The equivalent to `wp_upload_dir()`.
* `_wp_filter_font_directory()`: To run on the `upload_dir` filter, this sets the default destination of the fonts directory and fires the `font_dir` filter.
`wp_get_font_dir()` has been modified to be a lightweight getter for the font directory. It returns the location without attempting to create it. The equivalent to `wp_get_upload_dir()`.
Follow up to [57740].
Props peterwilsoncc, mukesh27, mikachan, costdev, mmaattiiaass, swissspidy, youknowriad, dd32, grantmkin.
Fixes#60652.
Built from https://develop.svn.wordpress.org/trunk@57868
git-svn-id: http://core.svn.wordpress.org/trunk@57369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset updates a translation string to ensure the "Patterns" menu item introduced in [57543] is translatable.
This quickfix simply removes the erroneous `context` parameter so no new string is introduced during WP 6.5 string freeze period. A follow-up changeset will be needed to replace the current `__()` function with `_x()` and put back the `context` parameter.
Follow-up to [57543].
Props jdy68, audrasjb, kebbet, swissspidy.
Fixes#60825.
Built from https://develop.svn.wordpress.org/trunk@57864
git-svn-id: http://core.svn.wordpress.org/trunk@57365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
One of the tests for the `wp_kses_xml_named_entities()` function used `utf8_encode( chr( 160 ) )` to set an expectation of a Unicode character for a non-breaking space.
It is understandable that this expectation was previously set this way, as it is not possible for a developer to distinguish between a ''breaking'' space and a ''non-breaking'' space visually, so the chances of the test accidentally breaking on an incorrect save when the plain Unicode character would be used, was high.
However, the `utf8_encode()` function is deprecated as of PHP 8.2, and its use needs to be removed from the WP codebase.
PHP 7.0 has introduced [https://wiki.php.net/rfc/unicode_escape Unicode escape sequences], which allows to create a text string using Unicode characters referenced by their codepoint. By switching the test case to provide the test expectation using a Unicode escape sequence, we remove the use of the deprecated PHP function and still preserve the safeguard against the test accidentally breaking.
Follow-up to [52229].
Props jrf, afercia, poena, SergeyBiryukov.
See #55603, #60705.
Built from https://develop.svn.wordpress.org/trunk@57861
git-svn-id: http://core.svn.wordpress.org/trunk@57362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The hooks fire before the general `delete_post` / `deleted_post` hooks and have the same parameters.
They complement the `save_post_{$post->post_type}` hook added in [25050] and the `edit_post_{$post->post_type}` hook added in [43617].
Props benniledl, swissspidy, dargus.
Fixes#60433.
Built from https://develop.svn.wordpress.org/trunk@57853
git-svn-id: http://core.svn.wordpress.org/trunk@57354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow-up to [57753] to make tests more robust, as there were multiple permission-related errors in the hosting test results.
With this change, the tests now don’t try setting an owner that doesn’t exist.
Props peterwilsoncc, costdev, javiercasares.
See #57774.
Built from https://develop.svn.wordpress.org/trunk@57849
git-svn-id: http://core.svn.wordpress.org/trunk@57350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow up to [57687]. If no icons of the preferred type are available, then the icon array should return the collection of valid icons found, rather than an empty array.
Props sabernhardt, swissspidy, sabernhardt, antpb, joedolson.
Fixes#60740.
Built from https://develop.svn.wordpress.org/trunk@57845
git-svn-id: http://core.svn.wordpress.org/trunk@57346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This prunes stores and configurations that are empty arrays, as stores are expected to be JSON objects.
By not printing empty configurations, less redundant data is serialized into the HTML.
Props jonsurrell, luisherranz, darerodz, gziolo, swissspidy.
Fixes#60761.
Built from https://develop.svn.wordpress.org/trunk@57841
git-svn-id: http://core.svn.wordpress.org/trunk@57342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensures parity with the `script_loader_src` filter for regular scripts, allowing the URL to be filtered, for example to load them from a CDN or alter query parameters.
Props dd32, peterwilsoncc, westonruter.
Fixes#60742.
Built from https://develop.svn.wordpress.org/trunk@57840
git-svn-id: http://core.svn.wordpress.org/trunk@57341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `WP_REST_Search_Controller`, the `type` parameter is accessed via the sanitization callback for the `subtype` parameter, which is too early for `type` itself to be already sanitized. This change adds a type check in the `get_search_handler()` method to prevent errors when the type doesn’t match.
Props swissspidy, timothyblynjacobs, dd32.
Fixes#60771.
Built from https://develop.svn.wordpress.org/trunk@57839
git-svn-id: http://core.svn.wordpress.org/trunk@57340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds an explicit 1 hour expiration for the translation file cache introduced in [57287] / #58919.
This prevents stale caches when a site does not use the regular way of installing language packs, for example when an atomic filesystem is involved.
Also configures the `translation_files` group as a global cache group on multisite.
Props dd32.
Fixes#60764.
Built from https://develop.svn.wordpress.org/trunk@57831
git-svn-id: http://core.svn.wordpress.org/trunk@57332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a follow-up to [57717] to ensure that classic themes without a `theme.json` file or without `appearanceTools: true` in `theme.json` do not have shadow controls by default.
Props wildworks, vcanales, madhudollu, swissspidy, youknowriad.
Fixes#60633
Built from https://develop.svn.wordpress.org/trunk@57827
git-svn-id: http://core.svn.wordpress.org/trunk@57328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Use a priority of 100 to ensure that other filters can add additional directives before the processing starts.
This way, directives will be processed even if the `$parsed_block` variable is edited by a filter.
Props cbravobernal, swissspidy, flixos90, joemcgill, gziolo.
Fixes#60743.
Built from https://develop.svn.wordpress.org/trunk@57826
git-svn-id: http://core.svn.wordpress.org/trunk@57327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Short-circuits directive processing when the markup does not actually contain any `data-wp-*` attributes.
This reduces function calls and memory usage for the best case scenario due to not involving `WP_HTML_Tag_Processor`.
Props joemcgill, swissspidy, gziolo, cbravobernal, flixos90.
Fixes#60749.
Built from https://develop.svn.wordpress.org/trunk@57824
git-svn-id: http://core.svn.wordpress.org/trunk@57325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a test to ensure proper processing of directives on special HTML elements,
or HTML which contains special elements. These special elements are defined by
the HTML API and are the HTML elements which cannot contain other tags, such as
the IFRAME, SCRIPT, TEXTAREA, TITLE, elements, etc...
The server diretive processor performs a custom tracking of HTML structure and
this test ensures it isn't mislead by the handling of those special elements.
Developed in https://github.com/WordPress/wordpress-develop/pull/6247
Discussed in https://core.trac.wordpress.org/ticket/60746
Props santosguillamot, cbravobernal, mukesh27, westonruter, swissspidy, dmsnell.
Follow-up to [57348].
Fixes#60746.
Built from https://develop.svn.wordpress.org/trunk@57822
git-svn-id: http://core.svn.wordpress.org/trunk@57323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes the "Pattern overrides" section from features.
Also updates the field guide link, this link should redirect correctly once the post is published.
Follow-up to [57715], [57767].
Props ryelle, benjamin_zekavica.
See #60303.
Built from https://develop.svn.wordpress.org/trunk@57809
git-svn-id: http://core.svn.wordpress.org/trunk@57310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When encountering text nodes in an HTML document, the HTML parser needs
to run the active format reconstruction algorithm, even if it doesn't
stop to visit those text nodes. This is because the formats, which might
need reconstructing, will impact the breadcrumbs of all downstream nodes
from the text node.
In this patch, this process is triggered, which properly triggers the
active format reconstruction. It also enables the visiting of other token
types as is possible in the Tag Processor.
Developed in https://github.com/WordPress/wordpress-develop/pull/6054
Discussed in https://core.trac.wordpress.org/ticket/60170
Props: dmsnell, jonsurrell, westonruter.
Fixes: #60455.
Follow-up to: [57348].
Built from https://develop.svn.wordpress.org/trunk@57806
git-svn-id: http://core.svn.wordpress.org/trunk@57307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When making repeated updates to a document, the Tag Processor will end
up copying the entire document once for every update. This can lead to
catastrophic behavior in the worse case.
However, when batch-applying updates it's able to copy chunks of the
document in one thread and only end up copying the entire document once
for the entire batch.
Previously the Tag Processor has been eagerly applying udpates, but in
this patch it defers applying those updates as long as is possible.
Developed in https://github.com/WordPress/wordpress-develop/pull/6120
Discussed in https://core.trac.wordpress.org/ticket/60697
Props: dmsnell, bernhard-reiter, jonsurrell, westonruter.
Fixes#60697.
Follow-up to [55706], [56941], [57348].
Built from https://develop.svn.wordpress.org/trunk@57805
git-svn-id: http://core.svn.wordpress.org/trunk@57306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes settings that are the default value or required for side-loading from the `WP_REST_Font_Faces_Controller::handle_font_file_upload()`.
This is to harden the endpoint and future proof against any changes to `wp_handle_upload()` and related functions/security checks.
Props peterwilsoncc, dd32.
Fixes#60741.
Built from https://develop.svn.wordpress.org/trunk@57804
git-svn-id: http://core.svn.wordpress.org/trunk@57305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Resetting the `$wp_current_filter` global during test teardown is unnecessary, as it is taken care of by the unit test's base class.
This changeset removes the reset accordingly.
Follow-up [57790].
Props swissspidy, timothyblynjacobs.
See #60671.
Built from https://develop.svn.wordpress.org/trunk@57799
git-svn-id: http://core.svn.wordpress.org/trunk@57300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For PRs that originate from forked repositories, `pull_request_review` and `pull_request_review_comment` events do not have the permissions necessary to comment on the PR.
This avoids needlessly running the bot when these conditions are met.
Props jorbin, wildworks.
See #60733.
Built from https://develop.svn.wordpress.org/trunk@57795
git-svn-id: http://core.svn.wordpress.org/trunk@57296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset switches back the admin menu items `height` property to `px` unit to prevent issues with themes using `html { font-size: 62.5%; }`.
Follow-up to [57765].
Props bgnicolepaschen, sabernhardt, huzaifaalmesbah, ironprogrammer, shailu25.
Fixes#60707.
See #43633.
Built from https://develop.svn.wordpress.org/trunk@57792
git-svn-id: http://core.svn.wordpress.org/trunk@57293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a new `rest_pre_insert_{$this->post_type}` filter in the `WP_REST_Templates_Controller`, where it is applied to the return value of the `prepare_item_for_database` method. (This is consistent with the `WP_REST_Post_Controller`, where that filter has existed before.)
The new filter is then used to inject hooked blocks into the template (or template part) content received via the endpoint, prior to persisting it to the database.
This supersedes the previous mechanism, which was using the `rest_after_insert_{$this->post_type}` ''action'', from which it performed an additional `wp_update_post` call to update the template (part) content with the hooked blocks injected. The new technique eschews that additional call and the resulting extra revision it created, as well as a problem with regard to duplicated escaping and sanitization, which had caused some special characters to be garbled.
Props tomjcafferkey, gziolo, swissspidy, karolmanijak.
Fixes#60671.
Built from https://develop.svn.wordpress.org/trunk@57790
git-svn-id: http://core.svn.wordpress.org/trunk@57291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add `fetchpriority` to the attributes accepted by the `wp_preload_resources` filter. Developers can now use this filter to set fetchpriority for resources being preloaded.
Props nihar007, luboslives, tabrisrp.
Fixes#58510.
Built from https://develop.svn.wordpress.org/trunk@57789
git-svn-id: http://core.svn.wordpress.org/trunk@57290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes several refinements to the various error messages displayed throughout the WordPress admin related to plugin dependencies. Additionally, it adds some conditions to display more appropriate messages for multisite installs with proper context to the user’s capabilities.
Props costdev, swissspidy, afragen, huzaifaalmesbah, knutsp.
Fixes#60465.
Built from https://develop.svn.wordpress.org/trunk@57770
git-svn-id: http://core.svn.wordpress.org/trunk@57271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes several refinements to the various notices displayed in the WordPress admin related to plugin dependencies. Additionally, it adds some conditions to display more appropriate messages for multisite installs with proper context to the user’s capabilities.
Props costdev, joedolson, afragen, swissspidy, peterwilsoncc, euthelup.
Fixes#60465.
Built from https://develop.svn.wordpress.org/trunk@57769
git-svn-id: http://core.svn.wordpress.org/trunk@57270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In some cases, it's possible to seek back into a location found inside
an element which has been closed before the point in the document where
the `seek()` was made. In these cases the breadcrumb stack is lost, and
calling `get_breadcrumbs()` after the seek will return the wrong information.
In this patch, the HTML Processor takes a conservative approach and
moves to the front of the document, then reparses the document until
it reaches the sought-after location. This ensures consistency on
the stack of open elements and active formats, and preserves
breadcrumbs.
Developed in https://github.com/WordPress/wordpress-develop/pull/6185
Discussed in https://core.trac.wordpress.org/ticket/60687
Props jonsurrell.
Follow-up to [60687].
See #58517.
Fixes#60687.
Built from https://develop.svn.wordpress.org/trunk@57768
git-svn-id: http://core.svn.wordpress.org/trunk@57269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the spacing between media toolbar elements in grid and list view did not match. We now use the same select margin across both views.
Props desrosj, seusmaniqbal, ianbelanger, subrataemfluence, sabernhardt, pooja1210, sumitbagthariya16, shailu25, devmuhib, huzaifaalmesbah, audrasjb.
Fixes#43904.
Built from https://develop.svn.wordpress.org/trunk@57764
git-svn-id: http://core.svn.wordpress.org/trunk@57265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In gettext, `0x950412de` is used to signal GNU MO files. In `WP_Translation_File_MO` this magic marker is used to detect whether a file uses little endian or big endian.
On 32 bit systems, this number will be interpreted by PHP as a float rather than an integer. This change adds extra casting to force an integer.
A similar change was done in the pomo library in the past, see #3780.
Props tmatsuur, swissspidy.
Fixes#60678.
Built from https://develop.svn.wordpress.org/trunk@57763
git-svn-id: http://core.svn.wordpress.org/trunk@57264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Increases clarity about where the function belongs to, bringing it in line with other related functions.
After initially merging this change in [57742] and reverting it in [57743], this reintroduces it now that the Gutenberg packages have been updated accordingly in [57760].
Props swissspidy, gziolo, cbravobernal, youknowriad, ankitmaru, westonruter, luisherranz, darerodz.
Fixes#60575.
Built from https://develop.svn.wordpress.org/trunk@57762
git-svn-id: http://core.svn.wordpress.org/trunk@57263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
GitHub recently sunset support for Subversion, causing the `precommit:emoji` Grunt script to break. Since there’s no direct replacement for `svn ls` in Git, this has been replaced with a query through the GitHub CLI.
This also adds a step in the workflow that tests the build process to run the `precommit:emoji` script to ensure no changes to built files are missed when updating the Twemoji library in the future.
Follow up to [57626].
Props kraftbj, peterwilsoncc, swissspidy.
Fixes#60520. See #57600.
Built from https://develop.svn.wordpress.org/trunk@57758
git-svn-id: http://core.svn.wordpress.org/trunk@57259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the following GitHub Actions to their latest versions:
- `shivammathur/setup-php` from `2.29.0` to `2.30.0`
- `actions/cache` from `4.0.0` to `4.0.1`
- `ramsey/composer-install` from `2.2.0` to `3.0.0`
- `codecov/codecov-action` from `4.0.1` to `4.1.0`
This should address the remaining notices caused by running Node.js 16.x on GitHub Actions runner machines in `trunk`.
Follow up to [57197], [57362], [57655].
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57757
git-svn-id: http://core.svn.wordpress.org/trunk@57258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add parity between site icon, custom header, and default image crop behaviors. [53027] fixed a bug where alt text and caption were not copied on custom headers, but did not apply that change in any other context.
Deprecate the `create_attachment_object` method in the `Wp_Site_Icon` and `Custom_Image_Header` classes and replace that functionality with the new function `wp_copy_parent_attachment_properties()` to improve consistency.
Props afercia, rcreators, jorbin, joedolson, huzaifaalmesbah, shailu25, swissspidy, mukesh27.
Fixes#60524.
Built from https://develop.svn.wordpress.org/trunk@57755
git-svn-id: http://core.svn.wordpress.org/trunk@57256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Unintended leading whitespace at the beginning of a raw MySQL query led to unexpected behavior such as broken pagination. Eliminating said whitespace avoids that.
Adds unit tests to prevent regressions.
Props wpfed, swissspidy, ironprogrammer, tadamarketing, afercia.
Fixes#56841.
Built from https://develop.svn.wordpress.org/trunk@57750
git-svn-id: http://core.svn.wordpress.org/trunk@57251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix missing subitem indicator when menu items in the Customizer are children of parent menu items & add menu item original title to button text. Adds parity with the admin menu editor and fixes a bug where the button text was 'untitled' if the menu item title had not been edited.
Props designsimply, afercia, celloexpressions, kushang78, joedolson, rcreators.
Fixes#32728.
Built from https://develop.svn.wordpress.org/trunk@57746
git-svn-id: http://core.svn.wordpress.org/trunk@57247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When removing a single item from the bulk edit box or when adding more items, the “All” checkboxes at the top and bottom of the posts list table should be properly toggled.
Props hiteshtalpada, oglekler, webcommsat, ugyensupport, chaion07, Toru.
Fixes#59121.
Built from https://develop.svn.wordpress.org/trunk@57745
git-svn-id: http://core.svn.wordpress.org/trunk@57246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Includes correcting the test class name.
Follow-up to [56714].
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57744
git-svn-id: http://core.svn.wordpress.org/trunk@57245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changing the font library is something we expect hosts to perform.
It's important that we make this filter as seemless as possible.
This commit prevents a potential infinite loop caused by calling wp_get_upload_dir() within the font_dir filter.
Props mmaattiiaass, ironprogrammer, costdev, swissspidy.
Fixes#60652.
Built from https://develop.svn.wordpress.org/trunk@57740
git-svn-id: http://core.svn.wordpress.org/trunk@57241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improvements made to the focus outline style for Twenty Twenty-Four caused a regression in the focus outlines of the block editor. This commit solves the regressions by reducing the CSS specificity while keeping the improvements.
Follow-up to [57554].
Props wildworks, poena, sabernhardt, youknowriad, oglekler.
Fixes#60535.
Built from https://develop.svn.wordpress.org/trunk@57739
git-svn-id: http://core.svn.wordpress.org/trunk@57240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When returning modifiable text in the HTML API, if the text segment
coerces to `false` inside `empty()`, then an empty string has been
returned instead of the string itself. For example, the text node in the
following HTML snippet:
{{{
<div>0</div>
}}}
In this patch the `empty()` check is removed. The purpose of the original
check was to skip further processing if the text content is empty, but
the check is not needed and the additioanl processing is minimal.
Removing the code removes the defect and leaves a cleaner method in its
absence.
Developed in https://github.com/WordPress/wordpress-develop/pull/6199
Follow-up to [57348]
Follow-up to #60170
Built from https://develop.svn.wordpress.org/trunk@57738
git-svn-id: http://core.svn.wordpress.org/trunk@57239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Moving pre-existing `wp_parse_id_list()` tests to their own file.
* Merging new and pre-existing `wp_parse_slug_list()` tests.
* Using named data provider in `wp_parse_list()` tests.
Follow-up to [25170], [40044], [44546], [57284], [57725].
Props pbearne, mukesh27, SergeyBiryukov.
Fixes#60218. See #60217, #59647.
Built from https://develop.svn.wordpress.org/trunk@57737
git-svn-id: http://core.svn.wordpress.org/trunk@57238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, `WP_Plugin_Dependencies::get_dependency_api_data()` attempted to set an array key using the `slug` property returned in a Plugins API response. However, the Plugins API response is filterable and may not contain a `slug` property.
Earlier in the method, a local `$slug` variable is used as a key for the same array.
For safety and consistency, this replaces array key references to `$information->slug` with `$slug`.
Follow-up to [57545].
Props pbiron, afragen, swissspidy, costdev.
Fixes#60540.
Built from https://develop.svn.wordpress.org/trunk@57736
git-svn-id: http://core.svn.wordpress.org/trunk@57237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
r57698 caused a regression for arrays of objects which have magic methods and dynamic properties. A fix is identified.
However, a deeper dive discovered additional scenarios which will require a different fix.
Reverting gives more time for resolving these scenarios and more soak time to discover if there are others.
Props dd32, jamescollins, swissspidy.
See #59774.
Built from https://develop.svn.wordpress.org/trunk@57732
git-svn-id: http://core.svn.wordpress.org/trunk@57233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This documents the new `filePath` property supported by `WP_Block_Patterns_Registry::register` and also updates the property name to camel case formatting to be consistent with other block pattern properties.
Props thekt12, spacedmonkey, joemcgill.
See #59532.
Built from https://develop.svn.wordpress.org/trunk@57731
git-svn-id: http://core.svn.wordpress.org/trunk@57232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This uses the new strings for alt text and site icon description that were introduced in [57713] as a part of #54370.
The strings are translated in PHP and then use `wp.i18n.sprintf` since the alt text strings live in a PHP file even though they are output as part of a template that is used in JavaScript.
Props westonruter, swissspidy, jorbin.
Fixes#60641.
Built from https://develop.svn.wordpress.org/trunk@57730
git-svn-id: http://core.svn.wordpress.org/trunk@57231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit updates the theme.json style generation to allow a font family name to be repeated across theme.json origins (default, theme, custom).
Props mmaattiiaass, hellofromtonya, arthur791004, ironprogrammer.
Fixes#60605.
Built from https://develop.svn.wordpress.org/trunk@57720
git-svn-id: http://core.svn.wordpress.org/trunk@57221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introducing the new content & design for the 6.5 About page & related pages. This style is simplified, with no header images, and brings back the illustrations from previous versions for Contribute, Freedoms, and Privacy.
This also includes a fix for heading hierarchy on the Get Involved page.
Props laurlittle, dansoschin, benjamin_zekavica, richtabor, joen, annezazu, swissspidy, marybaum, ryelle, huzaifaalmesbah.
See #60303.
Built from https://develop.svn.wordpress.org/trunk@57715
git-svn-id: http://core.svn.wordpress.org/trunk@57216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a number of issues, chief among them:
- Updates to the site title are reflected in the preview.
- Improve alt text for preview
- Make string describing site icon more succinct.
- Add inline documentation to JavaScript
Props kebbet, jorbin, swissspidy, afercia, mukesh27, alexstine, jameskoster, andraganescu.
Fixes#54370.
Built from https://develop.svn.wordpress.org/trunk@57713
git-svn-id: http://core.svn.wordpress.org/trunk@57214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the admin toolbar to have `role="menu"` and support opening for screen readers. Remove screen reader only log out link and collapse duplicate profile links into one link. This is an imperfect solution to a complex problem in the adminbar, but the lack of screen reader access to submenus is a major accessibility problem, and this fix provides access, even if the mechanism is imperfect.
Screen reader log out added in [21452].
Props abletec, Cheffheid, sabernhardt, alexstine, joedolson, afercia, sparklingrobots, danieltj, swissspidy, netweb, dionysous.
Fixes#34668, #43633.
Built from https://develop.svn.wordpress.org/trunk@57708
git-svn-id: http://core.svn.wordpress.org/trunk@57209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Modify `is_wp_version_compatible()` to return the expected result for major WordPress versions formatted as either `x.x` or `x.x.0` (for example `6.5` and `6.5.0`).
The WordPress project currently documents major version numbers in both formats leading to confusion for developers using the `is_wp_version_compatible()` function. As the PHP function `version_compare()` treats `x.x` and `x.x.0` as different version numbers this leads to unexpected results in the WP function.
This change removes a trailing `.0` from major version numbers to account for the WordPress project using the two formats interchangeably.
Props afragen, azaozz, costdev, joemcgill, jorbin, kkmuffme, sessioncookiemonster, swissspidy, wazeter.
Fixes#59448.
Built from https://develop.svn.wordpress.org/trunk@57707
git-svn-id: http://core.svn.wordpress.org/trunk@57208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [57283].
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57706
git-svn-id: http://core.svn.wordpress.org/trunk@57207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [34456], [34460].
Props costdev.
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57705
git-svn-id: http://core.svn.wordpress.org/trunk@57206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the `WP_Translation_Controller::set_locale()` call from `wp-settings.php`, which happened before the current user was loaded.
That caused translations to be missing when the site locale and user locale were different, as the translation was associated with the wrong locale.
Turns out this call was not needed at all, as the locale will be set/updated when calling `load_textdomain()` anyway.
Props oglekler.
See #59656.
Built from https://develop.svn.wordpress.org/trunk@57704
git-svn-id: http://core.svn.wordpress.org/trunk@57205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a followup to [57683], which adds additional unit test coverage to ensure block pattern content is not loaded from files during registration, but instead when those patterns are accessed. This also improves the `set_up` and `tear_down` methods for the `Tests_Blocks_wpBlockPattersRegistry` test class to ensure that any modifications made to registered blocks during the tests are reset after each test.
Props thekt12, joemcgill.
See #59532.
Built from https://develop.svn.wordpress.org/trunk@57703
git-svn-id: http://core.svn.wordpress.org/trunk@57204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes deprecated options that no longer have any effect, and updates the targeted ES version in line with WordPress’ browser support.
This change mostly allows new code to properly use trailing commas, as added by the Prettier formatter.
Future efforts should rather go towards adopting ESLint for code formatting, see #31823.
Props netweb.
Fixes#28236.
Built from https://develop.svn.wordpress.org/trunk@57702
git-svn-id: http://core.svn.wordpress.org/trunk@57203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Handles when the `$field` (i.e. key or property) is missing in one of the `$input_list` items by checking the key (array) or property (object) exists before using it for assignment.
Resolves the following bugs:
* a PHP warning for undefined key|property.
* `null` being set for that array or object within the returned list.
The changes resolve the issues in both `WP_List_Util::pluck()` (if invoked directly) and `wp_list_pluck()`.
Also includes an additional test for the scenario where the `wp_list_pluck()` `$index_key` is not `null`, the `$field` is missing in one of the `$input_list` items.
Follow-up to [55423], [51663], [42527], [38928].
Props iamarunchaitanyajami, davidbinda, hellofromTonya, helgatheviking.
Fixes#59774.
Built from https://develop.svn.wordpress.org/trunk@57698
git-svn-id: http://core.svn.wordpress.org/trunk@57199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `$x_redirect_by` parameter is supported by `wp_redirect()` and `wp_safe_redirect()` to set the `X-Redirect-By` header.
It can be modified via the `x_redirect_by` filter.
This updates the docblock to clarify that `false` can be passed to disable sending the header, which was previously undocumented behavior.
Props kkmuffme, swissspidy.
Fixes#60209.
Built from https://develop.svn.wordpress.org/trunk@57693
git-svn-id: http://core.svn.wordpress.org/trunk@57194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update XX-large font-sizes so that the responsive typography meets the minimum ratio between the min and max font-sizes of 0.61 required for accessible responsive typography.
Props mikachan, ryokuhi, poena, dhruvishah2203, joedolson.
Fixes#58603.
Built from https://develop.svn.wordpress.org/trunk@57690
git-svn-id: http://core.svn.wordpress.org/trunk@57191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changes to the `test_readme_mariadb_version()` test were made in an effort to stabilize the connection tests and CI failures. After the changeset, all multisite tests CI jobs connected and passed, but oddly all single site tests CI jobs repeatedly and consistently failed.
Reverting to unblock the CI jobs while continued investigation happens.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57689
git-svn-id: http://core.svn.wordpress.org/trunk@57190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix an issue where the actions sidebar in the media library could appear when there are no relevant actions available.
Props sruthi89, nithi22, ivanzhuck, dhruvishah2203, joemcgill, ukdrahul, joedolson, shailu25.
Fixes#58973.
Built from https://develop.svn.wordpress.org/trunk@57688
git-svn-id: http://core.svn.wordpress.org/trunk@57189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add an argument to `wp_mime_type_icon()` to control the file type returned. Following [57638], there are two file formats in the media icons directory. Different systems would pull up different files by default dependent on the order loaded into the cached array, causing intermittent test failures and unpredictable behavior.
Function update allows core usages to always return the `.svg` while maintaining backwards compatibility for any extended usage that expects a `.png`. Follow up to [57638].
Also handles a missed case in media list view.
Props SergeyBiryukov, sabernhardt, joedolson, antpb.
Fixes#31352.
Built from https://develop.svn.wordpress.org/trunk@57687
git-svn-id: http://core.svn.wordpress.org/trunk@57188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates `wp_register_font_collection()` and `WP_Font_Collection` so that only font families can be loaded from a file or URL.
All metadata, such as name, description, and list of font categories, needs to be passed directly in PHP so that it can be properly localized.
Props swissspidy, mmaattiiaass, grantmkin, youknowriad.
Fixes#60509.
Built from https://develop.svn.wordpress.org/trunk@57686
git-svn-id: http://core.svn.wordpress.org/trunk@57187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a bug introduced by [57129] and [56635] in which deprecating the previous `TEMPLATEPATH` and `STYLESHEETPATH` constants in favor of `get_template_directory()` and `get_stylesheet_directory()` functions caused the active theme template path to change when using `switch_to_blog()`.
This introduces a new function, `wp_set_template_globals()`, which is called during the bootstrap process to store the template paths to new globals values `$wp_template_path` and `$wp_stylesheet_path`. This restores behavior to how things worked prior to [56635] but retains the ability for template values to be reset for better testability.
Related #18298, #60025.
Props joemcgill, flixos90, mukesh27, swissspidy, manfcarlo, metropolis_john, jeremyfelt.
Fixes#60290.
Built from https://develop.svn.wordpress.org/trunk@57685
git-svn-id: http://core.svn.wordpress.org/trunk@57186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `test_readme_mariadb_version()` test method has been experiencing HTTP failures that result in test and CI failures.
This switches to mariadb.org which may result in more stable test runs.
Some additional safety assertions are also included.
Props hellofromTonya, SergeyBiryukov, costdev.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57684
git-svn-id: http://core.svn.wordpress.org/trunk@57185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the content for all registered patterns would get loaded on each request when the patterns are registered. Instead, this stores the path the pattern file during registration and reads the content the first time the pattern is used, which is a performance optimization.
Props thekt12, spacedmonkey, gziolo, aristath, joemcgill.
Fixes#59532.
Built from https://develop.svn.wordpress.org/trunk@57683
git-svn-id: http://core.svn.wordpress.org/trunk@57184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This bugfix resolves an issue in `export_wp()` with featured images.
When using Tools > Export and selecting either Posts or Pages (with or without a specific author), the resulting XML file now includes a XML item for each post|page's featured image attachment and its metadata.
Uses same chunking (for performance) and code patterns from existing code in the same file.
Adds a new test class for `export_wp()` with code coverage specific to this bugfix.
Follow-up to [34326], [14444], [6375], [6335].
Props billseymour, nateallen, petitphp, hellofromTonya, duck_, jane, rcain, jghazally, jghazally, smub, batmoo, axwax, creativeslice, dlocc, nacin, wonderboymusic, ganon, SergeyBiryukov, hlashbrooke, chriscct7, fischfood, hifidesign, ankit-k-gupta, 5um17, shailu25, huzaifaalmesbah, mukesh27.
Fixes#17379.
Built from https://develop.svn.wordpress.org/trunk@57681
git-svn-id: http://core.svn.wordpress.org/trunk@57182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [34085], [35183], [48937], [53782], [53785], [53883], [54402].
Props costdev.
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57680
git-svn-id: http://core.svn.wordpress.org/trunk@57181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the notice for listing dependencies in a plugin card was styled with the CSS `order` properties. This created a mismatch between the visual order and DOM order of elements in the plugin card.
For accessibility, visual order and DOM order must always match when they affect meaning and functionality.
This removes the CSS `order` properties and outputs the dependencies notice later, making the visual and DOM order match. Some unused/empty CSS is also removed.
Follow-up to [57545].
Props afercia, afragen, bosskhj, huzaifaalmesbah, mukesh27, costdev.
Fixes#60488.
Built from https://develop.svn.wordpress.org/trunk@57679
git-svn-id: http://core.svn.wordpress.org/trunk@57180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset allows using symbolic links for `editorScript` and `editorStyle` in `register_block_type()`. This adds `realpath` to template and stylesheet in `get_block_asset_url()` to ensure returning canonicalized absolute pathnames.
Follow-up to [56683].
Props antonlukin, spacedmonkey, maxpertici.
Fixes#59175.
See #58525.
Built from https://develop.svn.wordpress.org/trunk@57675
git-svn-id: http://core.svn.wordpress.org/trunk@57176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the tests for `WP_Plugin_Dependencies::get_dependency_names()` performed an API request to WordPress.org. If an HTTP failure occurred when connecting to WordPress.org, this could trigger test failures.
This mocks the API response to prevent HTTP failures from triggering test failures.
Follow-up to [57545].
Props swissspidy, peterwilsoncc, costdev.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57674
git-svn-id: http://core.svn.wordpress.org/trunk@57175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [49/tests], [198/tests], [34374], [48937], [52269].
Props costdev.
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57673
git-svn-id: http://core.svn.wordpress.org/trunk@57174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Allow returning null from the `hooked_block` and `hooked_block_{$hooked_block_type}` filters to suppress a hooked block from being inserted. This is required to allow extenders conditionally inserting a hooked block based on e.g. the value of an attribute of the anchor block.
Props swissspidy, gziolo, joshuatf, tomjcafferkey.
Fixes 60580.
Built from https://develop.svn.wordpress.org/trunk@57668
git-svn-id: http://core.svn.wordpress.org/trunk@57169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In test assertions for the `set_ignored_hooked_blocks_metadata` function, the actual value was erroneously passed as the first argument, and the expected value as the second. This changeset rectifies this by swapping the arguments.
Follow-up [57627].
See #60506.
Built from https://develop.svn.wordpress.org/trunk@57666
git-svn-id: http://core.svn.wordpress.org/trunk@57167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Merges the changes from Core and Gutenberg for the following tests:
- WP_REST_Global_Styles_Controller_Test
- Tests_Theme_wpThemeJsonResolver
- Tests_Theme_wpThemeJsonSchema
- Tests_Theme_wpThemeJson
This will help ensure the stability of the theme.json style generation.
Props ajlende, scruffian, aaronrobertshaw, get_dave, youknowriad.
Fixes#60387.
Built from https://develop.svn.wordpress.org/trunk@57662
git-svn-id: http://core.svn.wordpress.org/trunk@57163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensures that `wp_is_block_theme()` is not called too early before the themes are fully setup.
This addresses an issue where a parent theme was mistakenly marked as being missing.
Props scruffian, youknowriad, swissspidy, poena, dennysdionigi, bgardner, westonruter.
Fixes#60411.
Built from https://develop.svn.wordpress.org/trunk@57661
git-svn-id: http://core.svn.wordpress.org/trunk@57162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a counterpart to the dynamic `hooked_block_{$block_type}` filter introduced in [57354],
which makes it easier to modify all hooked blocks prior to insertion.
Also adds the hooked block type as an additional argument to both filters for consistency.
Props bernhard-reiter, swissspidy.
Fixes#60574.
Built from https://develop.svn.wordpress.org/trunk@57660
git-svn-id: http://core.svn.wordpress.org/trunk@57161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Automatic deactivation of dependents with unmet dependencies requires a write operation to the database. This was performed during Core's bootstrap, which risked the database and cache becoming out-of-sync on sites with heavy traffic.
No longer loading plugins that have unmet requirements has not had a final approach decided core-wide, and is still in discussion in #60491 to be handled in a future release.
The `plugin_data` option, used to persistently store plugin data for detecting unmet dependencies during Core's bootstrap, is no longer needed.
Follow-up to [57545], [57592], [57606], [57617].
Props dd32, azaozz, swissspidy, desrosj, afragen, pbiron, zunaid321, costdev.
Fixes#60457. See #60491, #60510, #60518.
Built from https://develop.svn.wordpress.org/trunk@57658
git-svn-id: http://core.svn.wordpress.org/trunk@57159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes two bugs in the font library.
- Fonts using special characters were not being rendered properly in the frontend.
- Allows the ability to use generic() in font family names.
Props mmaattiiaass, nithins53, kafleg, vivekawsm, swissspidy, audrasjb.
Fixes#60537.
Built from https://develop.svn.wordpress.org/trunk@57657
git-svn-id: http://core.svn.wordpress.org/trunk@57158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [56052].
See #59655.
Built from https://develop.svn.wordpress.org/trunk@57656
git-svn-id: http://core.svn.wordpress.org/trunk@57157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the following third-party GitHub Actions to their latest versions:
* Updates `actions/setup-node` from 4.0.1 to 4.0.2
* Updates `actions/upload-artifact` from 4.3.0 to 4.3.1
Props desrosj, thelovekesh.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57655
git-svn-id: http://core.svn.wordpress.org/trunk@57156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update JavaScript files for tag suggestions and the TinyMCE link plugin to use client side translations. This allows for `_n()` to be used for strings requiring singular and plural versions in which the correct form is only known client side.
Props audrasjb, chaion07, costdev, hellofromtonya, johnbillion, marybaum, nicolefurlan, oglekler, rebasaurus, rsiddharth, sergeybiryukov, shaampk1, shahariaazam, swissspidy, tobifjellner.
Fixes#48244.
Built from https://develop.svn.wordpress.org/trunk@57654
git-svn-id: http://core.svn.wordpress.org/trunk@57155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [48937], [54402], [54768], [57648].
Props costdev.
See #58683, #59655.
Built from https://develop.svn.wordpress.org/trunk@57653
git-svn-id: http://core.svn.wordpress.org/trunk@57154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [27055], [48937], [54402], [57244], [57648].
Props costdev.
See #58683, #59655.
Built from https://develop.svn.wordpress.org/trunk@57650
git-svn-id: http://core.svn.wordpress.org/trunk@57151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Limit the post types searched in `redirect_guess_404_permalink()` to public, searchable post types. This prevents redirects to 404 pages and the exposure of private post type slugs.
Props francescocarlucci, peterwilsoncc, rajinsharwar.
Fixes#59795.
Built from https://develop.svn.wordpress.org/trunk@57645
git-svn-id: http://core.svn.wordpress.org/trunk@57146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds logic that fixes the limitation for souces by allowing merging the `uses_context` defined by block bindings sources into supported block types. Each source defines the context it needs and it is added to the block types that are using the block bindings API.
Fixes#60525.
Props santosguillamot, gziolo, czapla, thekt12.
Built from https://develop.svn.wordpress.org/trunk@57641
git-svn-id: http://core.svn.wordpress.org/trunk@57142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [57516], the just-in-time translation loading logic was enhanced to support cases where only `.l10n.php` translation exist but no `.mo` or `.po` files. This caused a slight regression in `get_available_languages()`, which uses the list of files to populate the language dropdown list on the settings page.
To address this, the new file extension is now properly stripped off, and the resulting file list is de-duplicated. New test files are added to allow the existing tests to cover this new scenario.
See #59656.
Fixes#60553.
Built from https://develop.svn.wordpress.org/trunk@57639
git-svn-id: http://core.svn.wordpress.org/trunk@57140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replace the `.png` files in use for media library type icons with `.svg` versions. Improves sharpness, especially on high resolution screens and devices.
Props iseulde, melchoyce, joemcgill, sabernhardt, huzaifaalmesbah, wonderboymusic, ocean90, karmatosed, boemedia, bosskhj, joedolson.
Fixes#31352.
Built from https://develop.svn.wordpress.org/trunk@57638
git-svn-id: http://core.svn.wordpress.org/trunk@57139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `.editor-block-list__block` class was removed in WordPress 5.4. It is now replaced with a selector that works in the current versions and is backward compatible.
Follow-up to [43842].
Props poena, faisal03, ashikur698.
Fixes#59922.
Built from https://develop.svn.wordpress.org/trunk@57637
git-svn-id: http://core.svn.wordpress.org/trunk@57138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the `is-plain-object`, `memize`, `path-to-regexp`, and `tslib`.
These were also introduced in [56065] and have been integrated into the build process. Instead, these are now installed as peer dependencies through the `@/wordpress/*` packages that actually require them.
Follow up to [57634].
Props swissspidy.
See #59658.
Built from https://develop.svn.wordpress.org/trunk@57636
git-svn-id: http://core.svn.wordpress.org/trunk@57137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the following dependencies:
- `@pmmmwh/react-refresh-webpack-plugin` from `0.5.5` to `0.5.11`.
- `autoprefixer` from `10.4.16` to `10.4.17`.
- `copy-webpack-plugin` from `11.0.0` to `12.0.2`.
- `cssnano` from `6.0.1` to `6.0.3`.
- `dotenv` from `16.3.1` to `16.4.4`.
- `dotenv-expand` from `10.0.0` to `11.0.3`.
- `postcss` from `8.4.31` to `8.4.35`.
- `sass` from `1.69.3` to `1.70.0`.
- `sinon` from `16.0.3` to `16.1.3`.
- `source-map-loader` from `4.0.1` to `5.0.0`.
- `terser-webpack-plugin` from `5.3.9` to `5.3.10`.
- `wait-on` from `7.0.1` to `7.2.0`.
- `webpack` from `5.89.0` to `5.90.2`.
Additionally, `npm audit fix` has been run.
See #59658.
Built from https://develop.svn.wordpress.org/trunk@57635
git-svn-id: http://core.svn.wordpress.org/trunk@57136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the `@emotion/is-prop-valid`, `@emotion/memoize`, and `framer-motion` packages as direct dependencies.
These were introduced in [56065], but do not appear to have been integrated into the build process. Instead, these are now installed as peer dependencies to the `@wordpress/block-editor` and `@wordpress/components` packages.
Props gziolo, huzaifaalmesbah.
See #59658.
Built from https://develop.svn.wordpress.org/trunk@57634
git-svn-id: http://core.svn.wordpress.org/trunk@57135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves a WPCS warning:
{{{
Variable "$newlineEscape" is not in valid snake_case format, try "$newline_escape"
}}}
The `WP_Text_Diff_Renderer_inline` class extends the `Text_Diff_Renderer_inline` class from the `Text_Diff` package and should have the same parameters as the parent class method, per the Task 1 section of ticket #51553.
Follow-up to [7747], [55163].
See #59650.
Built from https://develop.svn.wordpress.org/trunk@57633
git-svn-id: http://core.svn.wordpress.org/trunk@57134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a bug where fonts could not be installed in PHP 8.1.0 through 8.1.11 due to incorrect MIME type assignment.
While `WP_Font_Utils::get_allowed_font_mime_types()` conditionally sets the MIME type for woff and woff2, it incorrectly checks against PHP 8.1.0. The MIME type change did not occur until PHP 8.1.12.
References:
* [https://github.com/php/php-src/issues/8805 PHP-src: finfo returns wrong mime type for woff/woff2 files].
* [https://www.php.net/ChangeLog-8.php#8.1.12 PHP 8.1.12 changelog].
* Tests: Adjust the expected mime type for WOFF fonts on PHP 8.1.12+ [55463].
* [https://github.com/WordPress/gutenberg/pull/59015 Gutenberg PR 59015].
Follow-up to [57539].
Props costdev, kafleg, hellofromTonya.
Fixes 60536.
Built from https://develop.svn.wordpress.org/trunk@57632
git-svn-id: http://core.svn.wordpress.org/trunk@57133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Pullquotes were not inheriting the correct styling from the block
editor. This commit resolves the issue by supporting typography options.
1. The `font-family` variable remains on the paragraph (both editor and front) so the citation continues to use the body font even when the site redefines `var(--pullquote--font-family)`.
2. The `font-size`, `font-style`, `font-weight`, `letter-spacing` and `line-height` are set on the Pullquote block to allow overriding with the sidebar settings. Then the block's paragraph element inherits those styles.
3. When the settings do not give a custom `line-height` from the sidebar, these stylesheets set the paragraph to `var(--pullquote--line-height)` instead of inheriting 1.6 from the block styles. This patch uses `:where()` to avoid increasing specificity.
Moving styles from the paragraph element to the block should not affect the citation, which has had its own styles for `font-size`, `font-style`, `font-weight` and `letter-spacing`.
Follow-up to [56959], [56451], [55089], [55088], [49574], [49320], [49216].
Props sabernhardt, poena, darshitrajyaguru97, harshgajipara, shailu25, skyakash12.
Fixes#57854.
Built from https://develop.svn.wordpress.org/trunk@57631
git-svn-id: http://core.svn.wordpress.org/trunk@57132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Decouple hooked blocks insertion from setting the `metadata.ignoredHookedBlocks` attribute on anchor blocks, and perform the latter step upon saving a template or template part to the database. This ensures that anchor blocks that have been newly added to a template (or part) on the client side will also get `ignoredHookedBlocks` metadata set correctly, thus preserving editor/front-end parity. Hooked block insertion, on the other hand, will continue to happen upon ''reading'' a template (or part).
Props gziolo, tomjcafferkey.
Fixes#60506.
Built from https://develop.svn.wordpress.org/trunk@57627
git-svn-id: http://core.svn.wordpress.org/trunk@57128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After a chaotic change of ownership, the `twitter/twemoji` library is now considered abandoned.
After waiting for this moment to arise, a fork was created by several former employees who had maintained the library which lives at `jdecked/twemoji` on GitHub.
This switches out where the underlying source code comes from for the library, and applies the 15.0.3 update, which adheres to the Unicode 15 spec and adds support for all Emoji introduced in Emoji 15.0.
This does not update the underlying `precommit:emoji` Grunt script responsible for updating `formatting.php`. After GitHub recently sunset support for SVN, the current process needs to be replaced with a new one. This will be handled in #60520.
Let the masses rejoice for the 🐦⬛ singing in the dead of night, secure 🛜, aromatic 🫚, and some very silly 🪿🪿.
RIP Twemoji. Long live Twemoji!
Props peterwilsoncc, kraftbj, jeffpaul, azaozz, dd32, hareesh-pillai, jorbin.
Fixes#57600.
Built from https://develop.svn.wordpress.org/trunk@57626
git-svn-id: http://core.svn.wordpress.org/trunk@57127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updated the global styles endpoints in the REST API to extend from existing posts and revisions controllers. This reduces duplicated code and inconsistencies. The revisions controller is now a subclass of the WP_REST_Revisions_Controller. Related redundant methods were removed and schema generation and collection parameters were adjusted to suit the global styles context. Updated permission checks, constructor, and collection parameters accordingly. This change allows for easy override of these classes using the `register_post_type_args` filter.
Props ramonopoly, spacedmonkey, mukesh27.
Fixes#60131.
Built from https://develop.svn.wordpress.org/trunk@57624
git-svn-id: http://core.svn.wordpress.org/trunk@57125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This enhancement refines the REST API server to automatically establish the maximum 'per_page' value for embedded objects, adhering to the endpoint's schema when not explicitly defined in the request. This adjustment elevates the limit from the default of 10 items to 100 items, significantly improving the likelihood of receiving the complete dataset of embedded objects.
Props manyourisms, lpawlik, spacedmonkey, kadamwhite, TimothyBlynJacobs.
Fixes#43439.
Built from https://develop.svn.wordpress.org/trunk@57623
git-svn-id: http://core.svn.wordpress.org/trunk@57124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [57592], some `update_option()` calls were removed from bootstrapping. However, this also removed a check to ensure an array key existed, and populated it if not.
Scaffolding tests by WP-CLI revealed that a plugin in the `active_plugins` option may not have data already stored within the `plugin_data` option, causing a PHP warning for an undefined array key. This data will be added the next time `get_plugins()` is called.
This adds a condition to ensure the requirements checks are only performed on plugins whose data is already stored in the `plugin_data` option.
Follow-up to [57592].
Props swissspidy, hellofromTonya, costdev.
Fixes#60461.
Built from https://develop.svn.wordpress.org/trunk@57622
git-svn-id: http://core.svn.wordpress.org/trunk@57123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The intended behaviour of Plugin Dependencies is that dependencies cannot be deleted until their dependents are deleted.
While the 'Delete' link was removed from the plugin row, the bulk actions checkbox remained enabled, allowing for deletion of dependencies through bulk actions.
This was unintended behaviour and the bulk actions checkbox is now disabled as intended.
Follow-up to [57545].
Props johnbillion, afragen, knutsp, huzaifaalmesbah, mukesh27, costdev.
Fixes#60471.
Built from https://develop.svn.wordpress.org/trunk@57620
git-svn-id: http://core.svn.wordpress.org/trunk@57121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Improve buttons flow on small viewports, taking longer translations into account.
* Make `alt` attributes translatable.
* Remove unused `id` attributes.
Follow-up to [57602].
Props kebbet, afercia, mukesh27.
See #54370.
Built from https://develop.svn.wordpress.org/trunk@57618
git-svn-id: http://core.svn.wordpress.org/trunk@57119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The Plugin Dependencies feature saves a list of any plugins that have been disabled due to unmet dependencies to a transient in order to give user feedback in the admin about what has taken place. This ensures that the DB operations to write this transient is skipped if there are no dependent plugins to deactivate.
Props joemcgill, costdev, afragen.
Fixes#60518.
Built from https://develop.svn.wordpress.org/trunk@57617
git-svn-id: http://core.svn.wordpress.org/trunk@57118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the `setCardButtonStatus()` JS function was called when a card had the ID 'plugin-information-footer'. However, the card will only exist on plugin install pages. This caused a failure when updating plugins from the plugin row on `plugins.php` due to an undefined `$card` variable.
This adds a guard to ensure that the current page is one of the plugin install pages, preventing the error and allowing plugin updates from the `plugins.php` rows to work as expected.
Follow-up to [57545].
Props Presskopp, huzaifaalmesbah, krupajnanda, hellofromTonya, krupalpanchal, costdev.
Fixes#60521.
Built from https://develop.svn.wordpress.org/trunk@57615
git-svn-id: http://core.svn.wordpress.org/trunk@57116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring consistency with the `image_make_intermediate_size` filter, which has the main DocBlock in `WP_Image_Editor_GD::_save()` and a duplicate hook reference in `WP_Image_Editor_Imagick::_save()`.
Follow-up to [57607].
See #21668.
Built from https://develop.svn.wordpress.org/trunk@57614
git-svn-id: http://core.svn.wordpress.org/trunk@57115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This update modifies the error handling mechanism in the REST API meta fields functionality. Instead of halting execution and returning on the first encountered error, it now collects all errors in a WP_Error object and continues execution. Thus, this enhancement enables handling and displaying of multiple errors in a single response, improving the debugging process.
Props TimothyBlynJacobs, spacedmonkey, hellofromTonya, oglekler.
Fixes#48823.
Built from https://develop.svn.wordpress.org/trunk@57611
git-svn-id: http://core.svn.wordpress.org/trunk@57112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the fatal error handler is triggered within a REST API request, it currently utilizes wp_die to display a specially formatted error response. However, crucial information captured by the fatal error handler, such as the exact line where the error occurred, is not included in the response due to potential security concerns, such as leaking file paths.
To address this limitation and aid developers in debugging, this enhancement introduces the inclusion of error data in the response when the `WP_DEBUG_DISPLAY` constant is set to true. This additional data, appended under the new key error_data, will facilitate more thorough debugging for REST API errors.
Props ecc, spacedmonkey, TimothyBlynJacobs, rcorrales.
Fixes#60014.
Built from https://develop.svn.wordpress.org/trunk@57610
git-svn-id: http://core.svn.wordpress.org/trunk@57111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Use 'theme_files' cache group for block pattern caches. Previously, block pattern cache data was not stored in a cache group and used the default group. This new cache group, is setup as a global cache group, meaning that sites using multisite, will have a single cache for block pattern data per theme. This change also no longer invalidate block pattern caches in multisite instances, meaning block pattern caches can be shared between sites on a network, meaning less repeated data in the object cache.
Props spacedmonkey, flixos90, joemcgill.
Fixes#60120.
Built from https://develop.svn.wordpress.org/trunk@57608
git-svn-id: http://core.svn.wordpress.org/trunk@57109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a new `image_save_progressive` filter which developers can use to control whether intermediate image sizes are saved in a progressive format (when available). By default, progressive image output is not used, matching the previous behavior.
Props: adamsilverstein, _ck_, markoheijnen, SergeyBiryukov, Japh, pmeenan, mikeschroder, derekspringer, buley, ericlewis, bahia0019, born2webdesign.
Fixes#21668.
Built from https://develop.svn.wordpress.org/trunk@57607
git-svn-id: http://core.svn.wordpress.org/trunk@57108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
RE: Plugins Dependencies.
The following micro-optimization improvements are included for finding each plugin's file relative to the plugins' directory within `wp-settings.php`:
* Move `trailingslashit()` before `foreach()`.
The path to the plugin directory is a constant. Invoking the `trailingslashit()` within the loop for each plugin is unnecessary and less performant.
This commit moves the plugin directory logic to before the loop. The result: the logic will now run 1x instead of Px where P represents the number of active and valid plugins to be loaded.
* Use `substr()` instead of `str_replace()` to extract the plugin's file relative to the plugins' directory.
`substr()` is more performant than `str_replace()`.
Why?
Per the PHP handbook:
>"This function returns a string or an array with all occurrences of search in subject replaced with the given replace value."
`str_replace()` searches the entire string to find and replace each substring occurrence.
whereas
>"Returns the portion of string specified by the offset and length parameters."
`substr()` starts at the given offset and stops at the given (or end of the) string length.
In other words, `substr()` iterates over less of and only a specific portion of the given input string, whereas `str_replace()` iterates through the entire string searching for matches (plural).
References:
* `str_replace()` https://www.php.net/manual/en/function.str-replace.php
* `substr()` https://www.php.net/manual/en/function.substr.php
* `strlen()` https://www.php.net/manual/en/function.strlen.php
* Show the comparison in action https://3v4l.org/TbQ9U.
Follow-up to [57545], [57592].
Props hellofromTonya, costdev.
Fixes#60510.
Built from https://develop.svn.wordpress.org/trunk@57606
git-svn-id: http://core.svn.wordpress.org/trunk@57107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Audio and video attachments can have a featured image, also known as a poster image. This functionality is now properly exposed by the `wp/v2/media` endpoint.
Props swissspidy, timothyblynjacobs, wonderboymusic, dlh, spacedmonkey.
Fixes#41692.
Built from https://develop.svn.wordpress.org/trunk@57603
git-svn-id: http://core.svn.wordpress.org/trunk@57104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This restores the site icon setting to its original home on the settings page where it lives with the title and tagline.
The base for this code was originally added in [32994] and then removed in [33329]. The majority of the modification to that version are to remove the no-js pieces and make the workflow completely inline rather than putting the cropping on a separate page.
Additionally, since image crops rely on the ability to upload an image, this setting is gated by the `upload_files` capability.
Follow-up to: [32994], [33329].
Props jorbin, audrasjb, mukesh27, joedolson, afercia, kebbet, swissspidy, obenland, jameskoster, kjellr, andraganescu, stacimc, mikeschroder, h71, krupajnanda, huzaifaalmesbah.
Fixes#54370.
See #16434.
Built from https://develop.svn.wordpress.org/trunk@57602
git-svn-id: http://core.svn.wordpress.org/trunk@57103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures the result of the font URL functions is a `string` before using it in `add_editor_style()`, to avoid PHP warnings on child themes. This similarily updates Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen, and Twenty Seventeen.
Props jordesign, SergeyBiryukov, sabernhardt, huzaifaalmesbah, shailu25.
Fixes#59704.
Built from https://develop.svn.wordpress.org/trunk@57601
git-svn-id: http://core.svn.wordpress.org/trunk@57102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit moves `line-height` to the Buttons container and removes the duplicate `outline` property.
Props sabernhardt, nidhidhandhukiya, monzuralam, shailu25, hrrarya, karmatosed, harshgajipara, nicolefurlan, fnpen, oglekler, poena, huzaifaalmesbah, audrasjb.
Fixes#58443.
Built from https://develop.svn.wordpress.org/trunk@57599
git-svn-id: http://core.svn.wordpress.org/trunk@57100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On upgrade, the `$_old_files` array is used to cleanup any files that exist in a previous version of core but are no longer present in the current version. Sometimes, an entire directory should be removed. In the past, when a parent directory was included in the array, subfiles were also included for good measure.
However, the code that removes the old files uses `$wp_filesystem->delete()` with the `$recursive` parameter set to `true`. With this setup, individual subfiles are not required to be individually listed when their parent directory is already included in the `$_old_files` array.
This commit removes all individual subfiles from the `$_old_files` array when their parent directory is already included.
Props SergeyBiryukov, mhshohel, pbiron, oglekler.
Fixes#58995.
Built from https://develop.svn.wordpress.org/trunk@57598
git-svn-id: http://core.svn.wordpress.org/trunk@57099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, `shortcode_parse_atts()` would return the input (an empty string) if a shortcode had no attributes, even though the documentation said otherwise.
Always returning an (empty) array reduces confusion and improves developer experience as the return value does not have to be manually checked in the shortcode itself.
Props: nicolefurlan, swissspidy, johnbillion, bedas.
Fixes#59249.
Built from https://develop.svn.wordpress.org/trunk@57597
git-svn-id: http://core.svn.wordpress.org/trunk@57098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Using the new technique introduced in [57157] of using a `metadata.ignoredHookedBlocks` attribute in the anchor block to store information about whether or not a hooked block should be considered for injection, extend said injection to encompass ''modified'' templates and parts.
Fixes#59646.
Props gziolo, matveb.
Built from https://develop.svn.wordpress.org/trunk@57594
git-svn-id: http://core.svn.wordpress.org/trunk@57095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[57545] introduced the Plugin Dependencies feature, which contains a new `plugin_data` option.
Previously, the `plugin_data` option was being updated during bootstrap and in `get_plugins()`, causing an error when using the install script as the options database table does not yet exist, and also risked an "out of sync" issue between the database and the cache on websites with heavy traffic.
This removes the calls to `update_option()` during Core's bootstrap, and guards the call in `get_plugins()` to ensure that it doesn't run when WordPress is installing.
Follow-up to [57545].
Props desrosj, swisspidy, huzaifaalmesbah, afragen, dd32, azaozz, costdev.
Fixes#60461. See #60457, #60491.
Built from https://develop.svn.wordpress.org/trunk@57592
git-svn-id: http://core.svn.wordpress.org/trunk@57093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes an issue where the `.privacy-policy` styles were applied to other locations than the footer only, like the `privacy-policy` page itself.
Props mnydigital, sabernhardt, huzaifaalmesbah, shailu25, poena.
Fixes#60469.
Built from https://develop.svn.wordpress.org/trunk@57589
git-svn-id: http://core.svn.wordpress.org/trunk@57090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the front end, this changeset restores the theme's default border color when (and only when) the block's text color is the default.
In the editor, these styles repurpose the user-selected color for the border, to match the front.
Props nidhidhandhukiya, sabernhardt, pooja1210, pouicpouic, poena, shailu25, ugyensupport, wasiur195, rajinsharwar, wasiur195, jivygraphics, huzaifaalmesbah, harshgajipara, nicolefurlan, sumitbagthariya16.
Fixes#58022.
Built from https://develop.svn.wordpress.org/trunk@57587
git-svn-id: http://core.svn.wordpress.org/trunk@57088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Occasionally, the tests verifying that old trashed posts or comments are not deleted if not old enough can take longer than expected, leading to false positives when comparing the timestamp in `wp_scheduled_delete()`, and resulting in subsequent test failures.
This commit aims to resolve the race condition.
Follow-up to [57224], [57237].
See #59938.
Built from https://develop.svn.wordpress.org/trunk@57583
git-svn-id: http://core.svn.wordpress.org/trunk@57084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The WP_HTML_Processor::has_bookmark() method has not correctly reported bookmarks
which have been set, because it wraps the given bookmark names when setting them.
Additionally, WP_HTML_Processor::seek() does not seek to correct location if HTML
has been updated because it wasn't flushing enqueued updates to the document.
In this patch both problems are resolved and added tests guard these behaviors
against future regressions.
Developed in https://github.com/WordPress/wordpress-develop/pull/6039
Discussed in https://core.trac.wordpress.org/ticket/60474
Follow-up to [56274].
Props dmsnell, jonsurrell.
Fixes#60474.
Built from https://develop.svn.wordpress.org/trunk@57582
git-svn-id: http://core.svn.wordpress.org/trunk@57083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that there is some spacing between the Cover and File blocks.
Props mukesh27, mayur8991, panchalhimani711, sabernhardt, itpathsolutions, thakordarshil, ankit-k-gupta, ugyensupport, pooja1210, shailu25, harshgajipara, darshitrajyaguru97, poena.
Fixes#58498.
Built from https://develop.svn.wordpress.org/trunk@57581
git-svn-id: http://core.svn.wordpress.org/trunk@57082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Pre-fill category fields in the Quick/Bulk Edit form with their current status.
When bulk editing, if only some of the selected items are in a given category, the category's checkbox will display a line to indicate an indeterminate status.
Originally committed in [56172], but reverted due to a bug that removed all categories. Updated commit fixes the bug, adds unit tests, and improves the accessibility of the indeterminate state checkboxes.
Props pavelevap, scribu, chasedsiedu, helen, joshcanhelp, ubernaut, Cyberchicken, laumindproductscomau, SergeyBiryukov, Marcoevich, tomybyte, thinkluke, virtality-marketing-solutions, Michalooki, dmsnell, itecrs, pannelars, WHSajid, samba45, Mte90, johnbillion, tomluckies, soulseekah, francina, oglekler, ajmcfadyen, mukesh27, costdev, hellofromTonya, peterwilsoncc, joedolson, pbiron, oglekler, webcommsat, jorbin, ajmcfadyen, huzaifaalmesbah.
Fixes#11302.
Built from https://develop.svn.wordpress.org/trunk@57580
git-svn-id: http://core.svn.wordpress.org/trunk@57081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that avatars design in the Post Author or Avatar blocks in the editor matches the front end.
Props pitamdey, shailu25, poena, sabernhardt, balub, sarath.ar, nicolefurlan, harshgajipara, pooja1210.
Fixes#59285.
Built from https://develop.svn.wordpress.org/trunk@57579
git-svn-id: http://core.svn.wordpress.org/trunk@57080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Refactors the processing of block bindings into steps:
- Gets the value for each "bound" attribute from the respective source.
- Returns the computer attributes with values from the sources.
- The computed attributes get injected into block's content.
- The `render_callback` gets the updated list of attributes and processeded block content.
Fixes#60282.
Props czapla, gziolo, andraganescu, santosguillamot.
Built from https://develop.svn.wordpress.org/trunk@57574
git-svn-id: http://core.svn.wordpress.org/trunk@57075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replace the `table` element used to present color palette selection in the user profile screen with generic elements. The extra semantics of a table are at best unhelpful and have some potential to great extraneous verbosity for screen readers.
Props sabernhardt, desrosj.
Fixes#53157.
Built from https://develop.svn.wordpress.org/trunk@57572
git-svn-id: http://core.svn.wordpress.org/trunk@57073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If a plugin also registers the category name `pages` in an `init` hook that runs after the theme's, it can override the label and description unintentionally.
With a prefix, extenders can still override it, but it would be intentional.
Props poena, swissspidy, shailu25.
Fixes#59839.
Built from https://develop.svn.wordpress.org/trunk@57569
git-svn-id: http://core.svn.wordpress.org/trunk@57070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The MySQL Docker containers for versions 5.7 and below do not support recent Apple silicone chips. Previously this was fixed by including `amd64/` as a prefix to the image name in the `docker-compose.yml` file (see [54096]). However, this stopped working after recent updates to Docker Desktop.
This changeset removes the `amd64/` prefix for the image used as the database container and raises the default version of MySQL in the local development environment to the current LTS version (8.0). Because this version is still maintained, there are `arm64` containers available to use.
This also documents a new workaround for contributors looking to run the local Docker environment using MySQL 5.7 or earlier, which entails creating a small `docker-compose.override.yml`.
Props bernhard-reiter, johnbillion, afragen, huzaifaalmesbah.
Fixes#59930.
Built from https://develop.svn.wordpress.org/trunk@57568
git-svn-id: http://core.svn.wordpress.org/trunk@57069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replaces the alias `join()` with its canonical `implode()`.
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.
Follow-up to [57539], [49193].
Props davidbinda.
Fixes#60473.
Built from https://develop.svn.wordpress.org/trunk@57567
git-svn-id: http://core.svn.wordpress.org/trunk@57068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since being introduced, the GitHub Actions workflow responsible for generating and submitting a test coverage report has used PHP 7.4. At the time, there were some issues with running the test suite on PHP 8.0+ which could have resulted in inaccurate reporting.
The test suite and WordPress in general are much more stable on 8.x now. The test coverage report should now be generated using the Docker container tagged `latest` (currently 8.2).
This will result in a very small decrease in the percentage of lines covered by test (-0.05%), but a slight increase in the percentage of functions and methods covered (+0.08%).
Props johnbillion.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57566
git-svn-id: http://core.svn.wordpress.org/trunk@57067 1a063a9b-81f0-0310-95a4-ce76da25c4cd