Removes query alteration from `build_comment_query_vars_from_block` by introducing a new way to pass the `$page` as argument to functions handling pagination for the comments.
Props cybr, santosguillamot, bernhard-reiter, gziolo.
Fixes#60806.
Built from https://develop.svn.wordpress.org/trunk@59081
git-svn-id: http://core.svn.wordpress.org/trunk@58477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Extends block context during block bindings processing. This implies that the context is extended ONLY for the blocks where bindings are defined and only when rendered on the page.
Props santosguillamot, gziolo, artemiosans, cbravobernal.
Fixes#61642.
Built from https://develop.svn.wordpress.org/trunk@59080
git-svn-id: http://core.svn.wordpress.org/trunk@58476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
HTML often appears in ways that are unexpected. It may be missing implicit tags, may have unquoted, single-quoted, or double-quoted attributes, may contain duplicate attributes, may contain unescaped text content, or any number of other possible invalid constructions. The HTML API understands all fo these inputs, but downline parsers may not, and HTML snippets which are safe on their own may introduce problems when joined with other HTML snippets.
This patch introduces the `serialize()` method on the HTML Processor, which prints a fully-normative HTML output, eliminating invalid markup along the way. It produces a string which contains every missing tag, double-quoted attributes, and no duplicates. A `normalize()` static method on the HTML Processor provides a convenient wrapper for constructing a fragment parser and immediately serializing.
Subclasses relying on the `serialize_token()` method may perform structural HTML modifications with as much security as the upcoming `\Dom\HTMLDocument()` parser will, though these are not
able to provide the full safety that will eventually appear with `set_inner_html()`.
Further work may explore serializing to XML (which involves a number of other important transformations) and adding constraints to serialization (such as only allowing inline/flow/formatting elements and text).
Developed in https://github.com/wordpress/wordpress-develop/pull/7331
Discussed in https://core.trac.wordpress.org/ticket/62036
Props dmsnell, jonsurrell, westonruter.
Fixes#62036.
Built from https://develop.svn.wordpress.org/trunk@59076
git-svn-id: http://core.svn.wordpress.org/trunk@58472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, there were a few cases where the modifiable text read from an HTML comment differs slightly from the parsed value of its inner text in a browser. This is due to the specific way that invalid HTML syntax tokens become "bogus comments."
This patch introduces a new method to the Tag Processor to allow differentiating these specific cases, such as when copying or serializing HTML from one source to another. Similar code has already been in use in the html5lib tests, and this patch simplifies the test runner, evidencing the fact that this method was already needed.
Developed in https://github.com/wordpress/wordpress-develop/pull/7342
Discussed in https://core.trac.wordpress.org/ticket/62036
Props dmsnell, jonsurrell.
See #62036.
Built from https://develop.svn.wordpress.org/trunk@59075
git-svn-id: http://core.svn.wordpress.org/trunk@58471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that the function applies the `wp_editor_settings` filter and merges the resulting array with the rest of TinyMCE init settings.
Includes a unit test to verify that the settings are merged correctly after adding the assignment of `array_merge()` result that was missed in the initial commit.
Follow-up to [44265], [59033].
Props kkmuffme, akshat2802, davidbaumwald, SergeyBiryukov.
Fixes#61754.
Built from https://develop.svn.wordpress.org/trunk@59074
git-svn-id: http://core.svn.wordpress.org/trunk@58470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Expands tests to ensure the version number of packages updated via NPM matches the version number used for registering the script in the script loader.
This adds tests for (by their registered name in WordPress):
* backbone
* clipboard
* hoverIntent
* hoverintent-js
* imagesloaded
* jquery-color
* jquery-core
* jquery-form
* masonry
* react-jsx-runtime
* underscore
* wp-polyfill-dom-rect
* wp-polyfill-element-closest
* wp-polyfill-fetch
* wp-polyfill-formdata
* wp-polyfill-inert
* wp-polyfill-node-contains
* wp-polyfill-object-fit
* wp-polyfill-url
This expands on the earlier tests introduced for:
* lodash
* moment
* react
* react-dom
* regenerator-runtime
An additional test is added to ensure that the data provider for these tests is maintained as libraries are added via package.json.
`@wordpress/*` scripts are excluded from these tests as wp-scripts generates a version number automatically based on the file's contents.
Additionally, the version of element-closest listed in package.json is updated to use a fixed version rather than a range. This reflects the current practice of WordPress to define the specific version in core. For the avoidance of doubt, this does not affect the version shipped in WordPress.
Follow up to [57185].
Props peterwilsoncc, jorbin.
Fixes#61855.
Built from https://develop.svn.wordpress.org/trunk@59071
git-svn-id: http://core.svn.wordpress.org/trunk@58467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the first `foreach` loop in Text_Diff::_check()`, `$prevtype` is `null`. As `instanceof` requires the class name term to be an object or string, a fatal error is thrown:
>Fatal error: Uncaught Error: Class name must be a valid object or a string on line 279
This change:
* Adds a simple test for the `Text_Diff::_check()` method, which is how the bug was discovered as the test could never pass with the code as-is.
* Adds a defensive guard to protect against the fatal. It checks if `$prevtype` is not `null` as a pre-condition to for checking the instance. This bugfix also resolves the failing test.
Follow-up to [49194], [7747].
Props jrf, hellofromTonya.
See #62083.
Built from https://develop.svn.wordpress.org/trunk@59070
git-svn-id: http://core.svn.wordpress.org/trunk@58466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `mysqli_ping()` function is deprecated as of PHP 8.4, though, in reality, the function wasn't working according to spec anymore since PHP 8.2 when the `libmysql` driver was dropped in favour of `libmysqlnd`, which was already the default (and recommended) driver since PHP 5.4.
The `mysqli_ping()` method was also not really correctly named as its functionality was to reconnect to the database, not just ping.
The alternative is to "manually" ping the database by sending a `DO 1` query (the cheapest possible SQL query).
Adding a PHP version based toggle was considered, but as mentioned above, the default driver has been `libmysqlnd` since PHP 5.4 and in that case, the function never worked anyway, so in reality `mysqli_ping()` was only really functional for the odd custom PHP compilation where `mysqli` was build against `libmysql` AND `reconnect` was not disabled.
With this in mind, this change replaces the call to `mysqli_ping()` with the `DO 1` query completely. If that query succeeds, it concludes the database connection is still alive. This solution should be the most stable as it will work for both PHP 7.2 <= 8.1, independently of which driver `mysqli` was compiled with, as well as for PHP 8.2+.
Note: It could also be considered to remove the function call to `mysqli_ping()` completely and rely on standard error handling in case the connection would have dropped, as after all, the fact that the connection existed at the moment the "ping" happened, is no guarantee that the connection will still exist when the next query is send.... this approach was not chosen so as WP has custom error handling and does not use the PHP native mysqli exceptions for this, which would make implementing this more awkward.
Includes a test to verify that the connection check works when there is a valid connection (this was previously not covered by tests).
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#mysqli_ping_and_mysqliping
* https://github.com/php/php-src/pull/11912#issuecomment-1671762583
* https://stackoverflow.com/questions/2546868/cheapest-way-to-determine-if-a-mysql-connection-is-still-alive/2546922#2546922
* php/php-src#11945
* https://wiki.php.net/rfc/mysqli_support_for_libmysql
* https://www.php.net/mysqli_ping
Follow-up to [56475], [27250], [27075].
Props jrf, hellofromTonya.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59069
git-svn-id: http://core.svn.wordpress.org/trunk@58465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset updates Twenty Twenty-Three and Twenty Twenty-Four and replaces text strings in HTML files with patterns to make the strings translatable.
Follow-up to [58459].
Props sabernhardt, karmatosed, iflairwebtechnologies, poena.
Fixes#61951.
Built from https://develop.svn.wordpress.org/trunk@59065
git-svn-id: http://core.svn.wordpress.org/trunk@58461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents a potential type errors when making use of the `gmt_offset` option by casting the value to a float prior to performing calculations with the value.
This mainly accounts for incorrect storage of values, such as an empty string or city name.
Follow up to [58923].
Props chaion07, hellofromtonya, kirasong, mhshohel, mukesh27, nicolefurlan, nihar007, nurielmeni, oglekler, peterwilsoncc, prionkor, rajinsharwar, rarst, rleeson, sabernhardt, SergeyBiryukov, swissspidy, toastercookie, verygoode.
Fixes#56358, #58986, #60629.
Built from https://develop.svn.wordpress.org/trunk@59064
git-svn-id: http://core.svn.wordpress.org/trunk@58460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The XML Parser extension still supports a quite dated mechanism for method based callbacks, where the object is first set via `xml_set_object()` and the callbacks are then set by passing only the name of the method to the relevant parameters on any of the `xml_set_*_handler()` functions.
{{{
xml_set_object( $parser, $my_obj );
xml_set_character_data_handler( $parser, 'method_name_on_my_obj' );
}}}
Passing proper callables to the `xml_set_*_handler()` functions has been supported for the longest time and is cross-version compatible. So the above code is 100% equivalent to:
{{{
xml_set_character_data_handler( $parser, [$my_obj, 'method_name_on_my_obj'] );
}}}
The mechanism of setting the callbacks with `xml_set_object()` has now been deprecated as of PHP 8.4, in favour of passing proper callables to the `xml_set_*_handler()` functions. This is also means that calling the `xml_set_object()` function is deprecated as well.
This commit fixes this deprecation for the `MagpieRSS::__construct()` method.
The change has not been not covered by tests. This class has been deprecated since WP 3.0.0 and is not covered by tests at all. Adding those now seems superfluous, all the more as the principle of the fix is no different than for the other files, so we can be sure it works anyway.
Note: Though this is "officially" an external library, this package is no longer externally maintained. The code style of the fix in the source file is in line with the existing code style for the file.
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://www.php.net/manual/en/function.xml-set-object.php
* https://www.php.net/manual/en/ref.xml.php
Follow-up to [4399].
Props jrf.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59063
git-svn-id: http://core.svn.wordpress.org/trunk@58459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The XML Parser extension still supports a quite dated mechanism for method based callbacks, where the object is first set via `xml_set_object()` and the callbacks are then set by passing only the name of the method to the relevant parameters on any of the `xml_set_*_handler()` functions.
{{{
xml_set_object( $parser, $my_obj );
xml_set_character_data_handler( $parser, 'method_name_on_my_obj' );
}}}
Passing proper callables to the `xml_set_*_handler()` functions has been supported for the longest time and is cross-version compatible. So the above code is 100% equivalent to:
{{{
xml_set_character_data_handler( $parser, [$my_obj, 'method_name_on_my_obj'] );
}}}
The mechanism of setting the callbacks with `xml_set_object()` has now been deprecated as of PHP 8.4, in favour of passing proper callables to the `xml_set_*_handler()` functions. This is also means that calling the `xml_set_object()` function is deprecated as well.
This commit fixes this deprecation for the `AtomParser::parse()` method.
This change is safeguarded via the new `AtomParser_Parse_Test` class.
Notes:
* Though this is "officially" an external library, this package is no longer externally maintained. The code style of the fix in the source file is in line with the existing code style for the file.
* It appears that this class is not actually used by WP Core itself, so it could be considered to deprecate the class. However, as the class is not currently deprecated, safeguarding the change with a test seemed prudent.
* The fixture used for the test reuses a fixture from the original package: https://code.google.com/archive/p/phpatomlib/source/default/source
* The new test class follows the recommended test format (naming convention of the class, `@covers` tag at class level, only testing one method) as per Trac tickets 62004 / 53010.
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://www.php.net/manual/en/function.xml-set-object.php
* https://www.php.net/manual/en/ref.xml.php
Follow-up to [5951].
Props jrf.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59062
git-svn-id: http://core.svn.wordpress.org/trunk@58458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Use `WP_UnitTestCase_Base::assertSamePathIgnoringDirectorySeparators()` and `WP_UnitTestCase_Base::normalizeDirectorySeparatorsInPath()` in existing tests.
Follow-up to [59057], [57753], [57215], [56635], [48937], [25002].
Props jrf.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@59061
git-svn-id: http://core.svn.wordpress.org/trunk@58457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the sixth part in a larger modularization of the data in `WP_Debug_Data`. Previously this was a single massive method drawing in debug data from various groups of related data, where the groups were independent from each other.
This patch separates the sixth of twelve groups, the `wp-media` info, into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/pull/7356
Discussed in https://core.trac.wordpress.org/ticket/61648
Props apermo, dmsnell.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@59060
git-svn-id: http://core.svn.wordpress.org/trunk@58456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
There are a number of ways to mitigate this:
* If it's an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()` et al methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods build in.
* For unknown _use of_ dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.
In this case, the property added are explicitly referenced in this class, so fall in the "known property" category.
Refs:
* https://wiki.php.net/rfc/deprecate_dynamic_properties
Props jrf.
See #56034.
Built from https://develop.svn.wordpress.org/trunk@59058
git-svn-id: http://core.svn.wordpress.org/trunk@58454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces `WP_UnitTestCase_Base::assertSamePathIgnoringDirectorySeparators()` and an associated helper method `WP_UnitTestCase_Base::normalizeDirectorySeparatorsInPath()` to allow for comparing two file path strings independently of OS-specific differences.
The normalization is done in a separate method to also allow this method to be used for path normalization within test methods themselves, like for normalizing a group of paths in an array.
The pretty specific method name for the helper (`normalizeDirectorySeparatorsInPath()`) is an attempt to prevent naming conflicts with methods which may exist in plugin test suites build on top of the WP Core test suite.
Props jrf, hellofromTonya.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@59057
git-svn-id: http://core.svn.wordpress.org/trunk@58453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The XML Parser extension still supports a quite dated mechanism for method based callbacks, where the object is first set via `xml_set_object()` and the callbacks are then set by passing only the name of the method to the relevant parameters on any of the `xml_set_*_handler()` functions.
{{{
xml_set_object( $parser, $my_obj );
xml_set_character_data_handler( $parser, 'method_name_on_my_obj' );
}}}
Passing proper callables to the `xml_set_*_handler()` functions has been supported for the longest time and is cross-version compatible. So the above code is 100% equivalent to:
{{{
xml_set_character_data_handler( $parser, [$my_obj, 'method_name_on_my_obj'] );
}}}
The mechanism of setting the callbacks with `xml_set_object()` has now been deprecated as of PHP 8.4, in favour of passing proper callables to the `xml_set_*_handler()` functions. This is also means that calling the `xml_set_object()` function is deprecated as well.
This commit fixes this deprecation for the `IXR_Message::parse()` method.
This change is safeguarded via the new`Tests_XMLRPC_Message::test_parse_sets_handlers()` test method.
Note: Though this is "officially" an external library, this package is no longer externally maintained. The code style of the fix in the source file is in line with the existing code style for the file.
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://www.php.net/manual/en/function.xml-set-object.php
* https://www.php.net/manual/en/ref.xml.php
Follow-up to [15612], [1346].
Props jrf, hellofromTonya.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59056
git-svn-id: http://core.svn.wordpress.org/trunk@58452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The XML Parser extension still supports a quite dated mechanism for method based callbacks, where the object is first set via `xml_set_object()` and the callbacks are then set by passing only the name of the method to the relevant parameters on any of the `xml_set_*_handler()` functions.
{{{
xml_set_object( $parser, $my_obj );
xml_set_character_data_handler( $parser, 'method_name_on_my_obj' );
}}}
Passing proper callables to the `xml_set_*_handler()` functions has been supported for the longest time and is cross-version compatible. So the above code is 100% equivalent to:
{{{
xml_set_character_data_handler( $parser, [$my_obj, 'method_name_on_my_obj'] );
}}}
The mechanism of setting the callbacks with `xml_set_object()` has now been deprecated as of PHP 8.4, in favour of passing proper callables to the `xml_set_*_handler()` functions. This is also means that calling the `xml_set_object()` function is deprecated as well.
This commit fixes this deprecation for the `TestXMLParser` helper utility. In this case, the callbacks were already using the recommended format and the call to `xml_set_object()` was completely redundant.
As this is a test utility and was already causing pre-existing tests using the utility to fail, there is no need for dedicated tests to cover this change.
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://www.php.net/manual/en/function.xml-set-object.php
* https://www.php.net/manual/en/ref.xml.php
Follow-up to [25002].
Props jrf.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59055
git-svn-id: http://core.svn.wordpress.org/trunk@58451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameters with a `null` default value, which are not explicitly declared as nullable.
This commit the one instance of this in the `WP_HTML_Processor` class.
Fixed by adding the nullability operator to the type, which is supported since PHP 7.1, so we can use it now the minimum supported PHP version is PHP 7.2.
As this deprecation is thrown at compile time, it can be seen at the top of the test output when running on PHP 8.4 (which will be gone once this change has been committed). It is not possible to write a test to cover this.
Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
Follow-up to [58867], [58769], [58304], [58192].
Props jrf.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59053
git-svn-id: http://core.svn.wordpress.org/trunk@58449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameters with a `null` default value, which are not explicitly declared as nullable.
The `Tests_HtmlApi_WpHtmlProcessorComments` test class contains one problematic parameter in the `test_comment_processing()` method declaration.
While this could be fixed by adding the nullability operator, the type declarations in the test method is removed instead, including other type declarations for this method and the second test method, which were not affected by the deprecation.
The reason for this is quite straight-forward: using type declarations in tests is bad practice and inhibits defense-in-depth type testing.
Using type declarations in tests prevents being able to test the "code under test" with unexpected input types as the values with unexpected (scalar) types will be juggled to the expected type between the data provider and the test method and the _real_ data value would therefore never reach the method under test.
The knock-on effects of this are:
* That the input handling of the "code under test" can not be safeguarded, whether this input handling is done via in-function type checking or via a type declaration in the "code under test".
* That if such "unexpected data type" tests are added to the data provider, they will silently pass (due to the type being juggled before reaching the "code under test"), giving a false sense of security, while in actual fact, these data sets would not be testing anything at all and if, for instance, the type declaration in the "code under test" would be removed, these tests would still pass, while by rights they should start failing.
Also note that this problem would only be exacerbated if the file would be put under `strict_types`.
Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
Follow-up to [58734].
Props jrf.
See #62061.
Built from https://develop.svn.wordpress.org/trunk@59052
git-svn-id: http://core.svn.wordpress.org/trunk@58448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The WordPress Hosting Test Results now supports multiple reports for the same commit from the same test bot. This updates the PHPUnit test workflow to submit results for each version of PHP running the tests.
Props swissspidy, jorbin, crixu, kirasong, desrosj.
See #61564.
Built from https://develop.svn.wordpress.org/trunk@59049
git-svn-id: http://core.svn.wordpress.org/trunk@58445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This patch any role that can edit a post, including custom post types, or edit theme options to read global styles from the API. This enables read-only access to global styles in the post editor. Test coverage in included.
Props ramonopoly, peterwilsoncc, mukesh27, aaronrobertshaw, mamaduka, spacedmonkey, talldanwp, timothyblynjacobs.
Fixes#62042.
Built from https://develop.svn.wordpress.org/trunk@59048
git-svn-id: http://core.svn.wordpress.org/trunk@58444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As indicated by name, this is a compatibility file which warrants more care to begin with, but it's still worth warning folks about how narrow function availability is in this file.
Props jorbin, dmsnell, helen.
See #61694.
Built from https://develop.svn.wordpress.org/trunk@59043
git-svn-id: http://core.svn.wordpress.org/trunk@58439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Set the AVIF encoder to work faster by raising heic:speed to 7 from the default of 5. AVIF generation time is reduced by up to 20% with minimal impact on image size.
Props: adamsilverstein, erikyo, mukesh27, yguyon, felixarntz, jzern.
Fixes#61758.
Built from https://develop.svn.wordpress.org/trunk@59042
git-svn-id: http://core.svn.wordpress.org/trunk@58438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add outlines and borders to mark the boundaries between the admin navigation menu and content and around adminbar submenus that are visible when Windows High Contrast Mode is enabled. This clarifies the page structure and makes high contrast mode easier to use.
Props wildworks, hbhalodia, sabernhardt, joedolson, rcreators.
Fixes#61616.
Built from https://develop.svn.wordpress.org/trunk@59041
git-svn-id: http://core.svn.wordpress.org/trunk@58437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Explicitly checks date parsing return values for `false`, so that `0` (the value returned for the UNIX epoch of `1970-01-01 00:00:00`) is correctly treated as a valid timestamp.
It should be valid to create a post dated to any point in history.
Props emmanuel78, sabernhardt, siliconforks, drjosh07, antpb, TimothyBlynJacobs.
Fixes#60184.
Built from https://develop.svn.wordpress.org/trunk@59040
git-svn-id: http://core.svn.wordpress.org/trunk@58436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`set_time_limit` can cause unexpected behavior so it general should be avoided. There are instances though where they should be used so those instances should be properly documented.
Props Rcrayno, ryan, kurtpayne, jorbin.
Fixes#21521. See #19487.
Built from https://develop.svn.wordpress.org/trunk@59039
git-svn-id: http://core.svn.wordpress.org/trunk@58435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The .env file allows for configuring how the WordPress Local environment should be configured. However, because the file is version controlled, developers must be careful not to commit their modifications.
This commit renames the .env file to be .env.example. During env start, the .env.example file is copied to .env if it does not exist. This allows for contributors to continue using the project without thinking about .env and to make changes when needed. This brings WordPress Core into the dotenv project guidelines.
Props johnbillion, afragen, h71, desrosj.
Fixes#52668.
Built from https://develop.svn.wordpress.org/trunk@59038
git-svn-id: http://core.svn.wordpress.org/trunk@58434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `password` property which gets sent as part of a request POST body while setting a post's password should not be checked when calculating post visibility permissions.
That value in the request body is intended to update the post, not to authenticate, and may be malformed or an invalid non-string type which would cause a fatal when checking against the hashed post password value.
Query parameter `?password=` values are the correct interface to check, and are also guaranteed to be strings.
Props mlf20, devansh016, antonvlasenko, TimothyBlynJacobs, kadamwhite.
Fixes#61837.
Built from https://develop.svn.wordpress.org/trunk@59036
git-svn-id: http://core.svn.wordpress.org/trunk@58432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a Ctrl/Command + Enter keyboard shortcut to insert the currently selected single media or multiple media items when selecting in the Media Library modal.
Props poena, hirschferkel, antpb, joedolson, skobe, rcreators, plaidharper.
Fixes#60369.
Built from https://develop.svn.wordpress.org/trunk@59035
git-svn-id: http://core.svn.wordpress.org/trunk@58431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds support for a new `search_semantics` enum query parameter that can be passed alongside the `search` string parameter. At this point, it only supports "exact" as possible value, but an enum is used for forward compatibility with potential enhancements like "sentence" search support. If `search_semantics=exact` is passed, it will look for an exact match rather than do a full text search, which for some use-cases is more appropriate and more performant.
Props mehulkaklotar, timothyblynjacobs, jimmyh61, ironprogrammer, johnregan3, mukesh27, costdev.
Fixes#56350.
Built from https://develop.svn.wordpress.org/trunk@59034
git-svn-id: http://core.svn.wordpress.org/trunk@58430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The REST API uses the "Allow" header to communicate what methods a user is authorized to perform on a resource. This works great when operating on a single item route, but can break down when needing to determine authorization over a collection of items.
This commit uses the "targetHints" property of JSON Hyper Schema to provide access to the "allow" header for "self" links. This alleviates needing to make a separate network request for each item in a collection.
Props mamaduka, noisysocks, peterwilsoncc, spacedmonkey, swissspidy, timothyblynjacobs, tyxla, youknowriad.
Fixes#61739.
Built from https://develop.svn.wordpress.org/trunk@59032
git-svn-id: http://core.svn.wordpress.org/trunk@58428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
With the introduction of Block Bindings, it became more common to see workflows where users need to see the custom fields that are available or connected. They were relying on the meta key, however it feelt too technical sometimes. The solution is adding a new label argument to include a human-readable name that can be used across the UI.
Props santosguillamot, mamaduka, gziolo, timothyblynjacobs, peterwilsoncc.
Fixes#61998.
Built from https://develop.svn.wordpress.org/trunk@59023
git-svn-id: http://core.svn.wordpress.org/trunk@58419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Increases the frequency of heartbeat API requests from once every 15 seconds to once every 10 seconds.
The purpose of this change is to reduce the length of time before a post becomes unlocked as a user navigates around the WordPress Dashboard and ceases editing a post.
`wp.heartbeat.interval()` has been modified to allow theme and plugin authors to set the heartbeat interval to any value between one second and one hour rather than limiting them to a fixed set of values.
Props azaozz, annezazu, jorbin, kirasong.
Fixes#61960.
Built from https://develop.svn.wordpress.org/trunk@59016
git-svn-id: http://core.svn.wordpress.org/trunk@58412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the part five in a larger modularization of the data in `WP_Debug_Data`. Previously this was a single massive method drawing in debug data from various groups of related data, where the groups were independent from each other.
This patch separates the fifth of twelve groups, the `wp-mu-plugins` info, into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/7305
Discussed in https://core.trac.wordpress.org/ticket/61648
Props apermo, dmsnell.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@59011
git-svn-id: http://core.svn.wordpress.org/trunk@58407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the part four in a larger modularization of the data in `WP_Debug_Data`. Previously this was a single massive method drawing in debug data from various groups of related data, where the groups were independent from each other.
This patch separates the fourth of twelve groups, the `wp-server` info, into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/7283
Discussed in https://core.trac.wordpress.org/ticket/61648
Props apermo, costdev, dmsnell, kebbet, mukesh27.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@59002
git-svn-id: http://core.svn.wordpress.org/trunk@58398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There are places in the HTML API code where some tools get confused and flag invalid types for the return of a function because they are unable to detect that the end of the function is unreachable.
Since PHP doesn't provide a way to encode total matching in the source code, this patch adds a few extra lines in those unreachable locations to satisfy any tooling which isn't able to fully analyze the code.
Additionally this serves as extra guarding in case someone changes these functions in a way which would break them and the existing test suite doesn't catch those breakages.
Developed in https://github.com/WordPress/wordpress-develop/pull/7315
Discussed in https://core.trac.wordpress.org/ticket/62018
Props dlh, dmsnell.
Fixes#62018.
Built from https://develop.svn.wordpress.org/trunk@59001
git-svn-id: http://core.svn.wordpress.org/trunk@58397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
About half of the file's code was a back-compat polyfill of base64 functions for IE9.
Since WordPress no longer supports IE9 as of version 4.8, and all modern browsers come with these functions, the polyfills can be removed.
Follow-up to [26072], [26131], [26601], [47771].
Props TobiasBg, sabernhardt.
Fixes#61995.
Built from https://develop.svn.wordpress.org/trunk@58997
git-svn-id: http://core.svn.wordpress.org/trunk@58393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
During a refactor to modularize the debug data class, it came up that the ordering of the sections inside of the returned debug info is relevant to existing UIs, as they iterate the array, which happens in insertion order.
This patch presets each section at the start to ensure that the ordering remains consistent even as code within the method is rearranged. As the mini-project progresses, this assignment will be the final place all the sections are referenced.
Developed in https://github.com/WordPress/wordpress-develop/pull/7289
Discussed in https://core.trac.wordpress.org/ticket/61648
Props apermo, dmsnell, sergeybiryukov.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@58996
git-svn-id: http://core.svn.wordpress.org/trunk@58392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `pop_until( $tag_name )` method in the stack of open elements should only be examining HTML elements, but it has only been checking the tag name. This has led to closing the wrong tags when run from inside foreign content. A very specific situation where this may arise is when a `TEMPLATE` closer is found inside foreign content, inside another template.
{{{
HTML:template SVG:template HTML:/template
<template><svg><template><foreignObject><div></template><div>
╰──< this outer TEMPLATE is closed by this one >───╯
}}}
This patch constains the method to checking for elements matching the tag name which are in the HTML namespace so that the proper detection occurs.
Developed in https://github.com/WordPress/wordpress-develop/pull/7286
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58867].
Props dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58992
git-svn-id: http://core.svn.wordpress.org/trunk@58388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The HTML API has been behaving as if CSS class name selectors matched class names in an ASCII case-insensitive manner. This is only true if the document in question is set to quirks mode. Unfortunately most documents processed will be set to no-quirks mode, meaning that some CSS behaviors have been matching incorrectly when provided with case variants of class names.
In this patch, the CSS methods have been audited and updated to adhere to the rules governing ASCII case sensitivity when matching classes. This includes `add_class()`, `remove_class()`, `has_class()`, and `class_list()`. Now, it is assumed that a document is in no-quirks mode unless a full HTML parser infers quirks mode, and these methods will treat class names in a byte-for-byte manner. Otherwise, when a document is in quirks mode, the methods will compare the provided class names against existing class names for the tag in an ASCII case insensitive way, while `class_list()` will return a lower-cased version of the existing class names.
The lower-casing in `class_list()` is performed for consistency, since it's possible that multiple case variants of the same comparable class name exists on a tag in the input HTML.
Developed in https://github.com/WordPress/wordpress-develop/pull/7169
Discussed in https://core.trac.wordpress.org/ticket/61531
Props dmsnell, jonsurrell.
See #61531.
Built from https://develop.svn.wordpress.org/trunk@58985
git-svn-id: http://core.svn.wordpress.org/trunk@58381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add the `OPTIONS /wp/v2/pages` route to the list. The request is made via the `useBlockEditorSettings` hook at the top of the editor React tree. Preloading should improve the editor's loading time.
Avoid hardcoding paths for the 'attachment' post type; use the `rest_get_route_for_post_type_items` helper method instead.
Props mamaduka, noisysocks.
See #61884.
Built from https://develop.svn.wordpress.org/trunk@58984
git-svn-id: http://core.svn.wordpress.org/trunk@58380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a guard to verify the result of `get_post_type_object()` before retrieving the `all_items` label, as the function returns `null` if the post type does not exist.
Follow-up to [24527].
Props pcarvalho, akshat280, mukesh27, SergeyBiryukov.
Fixes#60947.
Built from https://develop.svn.wordpress.org/trunk@58983
git-svn-id: http://core.svn.wordpress.org/trunk@58379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Exclude links from activating the comment submission shortcut.
[45790] introduced a shortcut to submit comment forms using `Ctrl/Cmd + Enter`. This keyboard combination is also the combination for opening a link in a new tab, which resulted in submitting the form when using the Log Out or Edit Profile links.
Props greentreefrog, sabernhardt, narenin.
Fixes#61919.
Built from https://develop.svn.wordpress.org/trunk@58981
git-svn-id: http://core.svn.wordpress.org/trunk@58377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improves the `'admin_bar_menu'` docblock by adding recommendations for customizing / changing existing items.
It also improves the `wp_admin_bar_render()` function's docblock by removing the "most optimal point" sentence.
The [58748] changeset moved the user menu to a higher priority level (of `9991`) to achieve:
>so nodes added with higher priorities will still be shown visually before the user and recovery menu items, as they were prior to [58215].
When hooking into `'admin_bar_menu'` with a priority level less than 9991 and attempting to get the `'my-account'` node, `null` is returned. While the preferred approach is to hook into `'wp_before_admin_bar_render'`, the documentation of the `'admin_bar_menu'` action was previously misleading.
Follow-up to [58748], [58759].
Props michaelwp85, narenin, sabernhardt, joedolson, costdev, jorbin, hellofromTonya, mukesh27, pbiron.
Fixes#61738.
Built from https://develop.svn.wordpress.org/trunk@58978
git-svn-id: http://core.svn.wordpress.org/trunk@58374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [57715], headings on the About pages were given `text-wrap: balance`. This rule causes unexpected breaks in non-latin langauges, e.g., Japanese, Korean. This fix sets the text-wrap to `pretty` for browsers that support it, and uses `balance` for English-only.
Props akshat2802, wildworks, ryelle, sabernhardt, hellofromTonya.
Fixes#60892.
Built from https://develop.svn.wordpress.org/trunk@58976
git-svn-id: http://core.svn.wordpress.org/trunk@58372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
It is recommended that for every option it is explicitly set whether to autoload it or not. This changeset updates relevant `update_option()` and `add_option()` calls.
Note that the `$autoload` parameter is only needed for `update_option()` if the option is potentially not present yet, i.e. the call will pass through to `add_option()`. Since WordPress core adds the majority of its options to the database during installation, only `update_option()` calls for dynamically added options need to be modified, which is what this changeset does.
As part of revisiting the autoload values for dynamically added WordPress core options, this changeset modifies some options to no longer be autoloaded, since they are only accessed in a few specific places that are not relevant for a regular request. These options are:
* `recently_activated`
* `_wp_suggested_policy_text_has_changed`
* `{upgradeLock}.lock`
* `dashboard_widget_options`
* `ftp_credentials`
* `adminhash`
* `nav_menu_options`
* `wp_force_deactivated_plugins`
* `delete_blog_hash`
* `allowedthemes`
* `{sessionId}_paused_extensions`
* `recovery_keys`
* `https_detection_errors`
* `fresh_site`
An upgrade routine is present as well that sets those options to no longer autoload for existing sites.
Props pbearne, flixos90, mukesh27, swissspidy, SergeyBiryukov, joemcgill, adamsilverstein.
Fixes#61103.
Built from https://develop.svn.wordpress.org/trunk@58975
git-svn-id: http://core.svn.wordpress.org/trunk@58371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A common use-case for the 'wp_get_loading_optimization_attributes' filter is to modify attributes based on the 'src' attribute. However, the `wp_img_tag_add_loading_optimization_attrs()` was not passing that attribute to the function as expected, which would make such usage of the filter unreliable. This changeset ensures the 'src' attribute is also passed in this scenario. All other calls to `wp_get_loading_optimization_attributes()` already included the attribute.
Props deepakrohilla, prestonwordsworth, mukesh27, adamsilverstein, joemcgill, flixos90.
Fixes#61436.
See #58893.
Built from https://develop.svn.wordpress.org/trunk@58974
git-svn-id: http://core.svn.wordpress.org/trunk@58370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces a filter to the `block_bindings_source_value` to allow developers to
modify the value returned by any block binding source.
Props snehapatil02, cbravobernal, gziolo, santosguillamot, bacoords, codersantosh.
Fixes#61181.
Built from https://develop.svn.wordpress.org/trunk@58972
git-svn-id: http://core.svn.wordpress.org/trunk@58368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
HTML parsing rules at times differentiate character tokens that are all null bytes, all whitespace, or other content. This patch introduces a new function which may be used to classify text node sub-regions and lead to more efficient application of these parsing rules.
Further, when classified in this way, application code may skip some rules and decoding entirely, improving performance. For example, this can be used to ease the implementation of skipping inter-element whitespace, which is usually not rendered.
Developed in https://github.com/WordPress/wordpress-develop/pull/7236
Discussed in https://core.trac.wordpress.org/ticket/61974
Props dmsnell, jonsurrell.
Fixes#61974.
Built from https://develop.svn.wordpress.org/trunk@58970
git-svn-id: http://core.svn.wordpress.org/trunk@58366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A mistake in the original code handling opening A elements in the HTML Processor led to mistakes in parsing where the Processor would bail in situations when it could have proceeded. While this was errant behavior, it didn't violate the public contract since it would bail in these situations.
This patch fixes the mistake, which was to only break out of the innermost loop instead of breaking from the containing loop, which resolves the issue.
Developed in https://github.com/WordPress/wordpress-develop/pull/7281
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [56274].
Props jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58966
git-svn-id: http://core.svn.wordpress.org/trunk@58362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the part three in a larger modularization of the data in `WP_Debug_Data`. Previously this was a single massive method drawing in debug data from various groups of related data, where the groups were independent from each other.
This patch separates the third of twelve groups, the `wp-database` info, into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/7143
Discussed in https://core.trac.wordpress.org/ticket/61648
Props dmsnell, kebbet, apermo.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@58964
git-svn-id: http://core.svn.wordpress.org/trunk@58360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents a deprecation warning saving options when the post by email feature is turned off in code using the `enable_post_by_email_configuration` filter.
Props ironprogrammer, manbo, narenin, sebastienserre, siliconforks.
Fixes#61144.
Built from https://develop.svn.wordpress.org/trunk@58963
git-svn-id: http://core.svn.wordpress.org/trunk@58359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a note that the functions return either an empty array or an empty string for a valid but non-existing ID, depending on the `$single` parameter.
Follow-up to [48658], [50641].
Props rodrigosprimo, jrf.
See #61608.
Built from https://develop.svn.wordpress.org/trunk@58962
git-svn-id: http://core.svn.wordpress.org/trunk@58358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The code block font-size was not the same in the editor and front. This sets it to 1em and corrects the value for preformatted elements along with adding border and padding in the editor for pre elements.
Props viralsampat, mi5t4n, brobken, sabernhardt.
Fixes#61845.
Built from https://develop.svn.wordpress.org/trunk@58960
git-svn-id: http://core.svn.wordpress.org/trunk@58356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
One of the benefits of contributing to WordPress is that contributors license their code under the GPL rather than assign copyright to the WordPress Foundation or another entity.
This updates the copyright notices in each of the bundled themes to acknowledge contributors own a portion of the copyright. For themes with a significant contribution from Automattic, the copyright notice is updated from Automattic.com to the legal entity Automattic Inc.
Props peterwilsoncc, desrosj, sabernhardt, jorbin, chanthaboune.
Fixes#61943.
Built from https://develop.svn.wordpress.org/trunk@58958
git-svn-id: http://core.svn.wordpress.org/trunk@58354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevent the AJAX search results from firing until after at least 2 characters have been typed into the search boxes. Toggle `autocomplete` value once AJAX is firing. Add a changeable minimum character threshold.
Props armandsdz, adamsilverstein, afercia, mklusak, finalwebsites, joedolson.
Fixes#38211.
Built from https://develop.svn.wordpress.org/trunk@58957
git-svn-id: http://core.svn.wordpress.org/trunk@58353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This update most notably drops support for jQuery `< 1.12` and `< 2.2`. WordPress has not shipped with a version that matches these ranges since version 4.4 (see [36285]/#35380).
The update also changes the library’s browser support policy to only support the latest Chrome, Firefox, Safari, and Edge. This closely matches Core’s current policy to support the last 2 versions of these browsers. The library’s README notes that other versions nay “also work correctly with this plugin but support is not guaranteed”, which is reasonably similar.
Props vipulgupta003.
Fixes#61835.
Built from https://develop.svn.wordpress.org/trunk@58956
git-svn-id: http://core.svn.wordpress.org/trunk@58352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The polyfill was added in [57492], but all browsers supported by WordPress already support import maps.
This not only disables the polyfill, but completely removes it as it was only added recently and there is no usage outside of core.
Props swissspidy, desrosj, luisherranz, gziolo.
Fixes#60970.
Built from https://develop.svn.wordpress.org/trunk@58952
git-svn-id: http://core.svn.wordpress.org/trunk@58348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit simplifies block style variation class name generation to ensure unique class names by replacing the hashing of block attributes in the block style variation class names with a call to `wp_unique_id`.
Doing so avoids potential for non-unique class names and conflicting styles when exact copies of a block are inserted via a repeated pattern.
Props aaronrobertshaw, martinkrcho, mukesh27, peterwilsoncc, ramonopoly.
Fixes#61877.
Built from https://develop.svn.wordpress.org/trunk@58951
git-svn-id: http://core.svn.wordpress.org/trunk@58347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In theme.json, individual font sizes may opt out of fluid typography if it is turned on globally.
This commit ensures that individual font size presets can also opt in to fluid typography if it is not turned on globally.
Props aaronrobertshaw, mmaattiiaass, ramonopoly, wildworks.
Fixes#61932.
Built from https://develop.svn.wordpress.org/trunk@58950
git-svn-id: http://core.svn.wordpress.org/trunk@58346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress 6.6 option autoload enhancements included discouraging the use of 'yes' and 'no' to indicate whether to autoload an option when calling `add_option()` or `update_option()`. Instead, a boolean should be used.
This changeset brings the newer autoload related functions `wp_set_option_autoload_values()`, `wp_set_options_autoload()`, and `wp_set_option_autoload()` in line with those changes. Additionally, it soft-deprecates the values more formally, as they should no longer be used. No PHP warnings will be emitted though as this is not a hard deprecation. This change is purely about documentation.
Props flixos90, joemcgill, jrf, mukesh27.
Fixes#61929.
See #61103, #61939.
Built from https://develop.svn.wordpress.org/trunk@58949
git-svn-id: http://core.svn.wordpress.org/trunk@58345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When medium-size thumbnails are disabled, PDF previews in the Media Library grid view now fall back to displaying full-size thumbnails instead of a generic document icon.
Props daleharrison, kushang78, mukesh27, sudipatel007, mai21, antpb.
Fixes#39630.
Built from https://develop.svn.wordpress.org/trunk@58947
git-svn-id: http://core.svn.wordpress.org/trunk@58343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change `browsePopup` to use `onkeydown`, pass the `event` parameter from the calling control, and adjust variable naming style.
The `browsePopup` method used for the image rotation menu used `onkeyup` to trigger events, which prevented capturing browser scroll actions with arrows occurring on `onkeydown`.
Props afercia, deepakvijayan, nirajgirixd, joedolson, antpb.
Fixes#60548.
Built from https://develop.svn.wordpress.org/trunk@58946
git-svn-id: http://core.svn.wordpress.org/trunk@58342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset does not modify any behavior, it only updates the code to use the recommended type for the `$autoload` parameter as of WordPress 6.6. The old values 'yes' and 'no' are only maintained in certain tests that are explicitly about these backward compatibility values.
Props flixos90, joemcgill, mukesh27.
Fixes#61939.
See #61103, #61929.
Built from https://develop.svn.wordpress.org/trunk@58945
git-svn-id: http://core.svn.wordpress.org/trunk@58341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since this file is loaded incredibly early, many functions are not available. Those deeply familiar with how load works might have some idea as to what's safe and what isn't, but it's generally confusing and a little opaque so let's warn people there be dragons.
Props helen, DrewAPicture, jorbin.
Fixes#38650.
Built from https://develop.svn.wordpress.org/trunk@58944
git-svn-id: http://core.svn.wordpress.org/trunk@58340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents the GitHub bot from posting a comment on pull requests requesting a trac ticket link if the ticket description includes a link via the ticket: prefix, eg ticket:61865.
The WordPress/WordPress-Develop repository is configured to automatically convert the text to a trac ticket link.
Props dd32, peterwilsoncc.
Fixes#61865.
Built from https://develop.svn.wordpress.org/trunk@58939
git-svn-id: http://core.svn.wordpress.org/trunk@58335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The commit syncs the following changes from Gutenberg:
- Background images: add support for theme.json ref value resolution gutenberg#64128
- Background images: ensure appropriate default values gutenberg#64192
- Background image: ensure consistency with defaults and fix reset/remove functionality gutenberg#64328
These changes brings consistency to the default background image styles WordPress applies to user uploaded images, and adds support for ref resolution to "background" style properties.
Props andrewserong, aaronrobertshaw.
Fixes #61858
Built from https://develop.svn.wordpress.org/trunk@58936
git-svn-id: http://core.svn.wordpress.org/trunk@58332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Move Etag HTTP header generation in `load-scripts.php` and `load-styles.php` to `WP_Dependencies`.
Introduces the method `WP_Dependencies::get_etag()` and associated unit tests.
Follow up to [57943].
Props vrajadas, martinkrcho, mukesh27.
Fixes#61485.
Built from https://develop.svn.wordpress.org/trunk@58935
git-svn-id: http://core.svn.wordpress.org/trunk@58331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update the capabilities check in `wp_http_supports` to use `WpOrg\Requests\Requests::has_capabilities` rather than the deprecated `WP_HTTP::_get_first_available_transport()`.
Props dd32, mukesh27, costdev, desrosj, johnbillion, jorbin, jrf, chaion07.
Fixes#37708.
Built from https://develop.svn.wordpress.org/trunk@58934
git-svn-id: http://core.svn.wordpress.org/trunk@58330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`_wp_normalize_relative_css_links()` used to normalize all non-absolute URLs regardless of whether it's a relative path or an absolute path. The normalization should only happen for relative paths (paths without a leading `/`) and not for absolute paths.
Reference: [https://www.rfc-editor.org/rfc/rfc1808#section-4 RFC 1808, Section 4, Step 4].
Follow-up to [52036], [52695], [52754], [55658], [55669].
Props scholdstrom.
Fixes#61909.
Built from https://develop.svn.wordpress.org/trunk@58932
git-svn-id: http://core.svn.wordpress.org/trunk@58328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The search block button was not the same back and front for background, text and font weight. This is an additional patch solving the previous issue of styles being in wrong section and also differences..
Props sabernhardt.
Fixes#61888.
Built from https://develop.svn.wordpress.org/trunk@58930
git-svn-id: http://core.svn.wordpress.org/trunk@58326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to avoid a security warning in Chrome, which could previously be triggered even if the default value is not actually used as a password.
Follow-up to [208], [230], [233], [662], [1599], [1601]
Props adamkheckler, sabernhardt, peterwilsoncc, psykro, petitphp.
Fixes#61332.
Built from https://develop.svn.wordpress.org/trunk@58928
git-svn-id: http://core.svn.wordpress.org/trunk@58324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the UI for previewing a site icon in general settings and the customizer to account for changes to browser designs over the past years.
Props joedolson, joen, kebbet, nhrrob, swissspidy, mukesh27, afercia, jorbin.
Fixes#60625.
Built from https://develop.svn.wordpress.org/trunk@58927
git-svn-id: http://core.svn.wordpress.org/trunk@58323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents a potential type error when calling `current_time( 'timestamp' )` by casting `get_option( 'gmt_offset' )` to a float prior to performing calculations with the value.
This mainly accounts for incorrect storage of values, such as an empty string or city name.
Follow up to [45856], [55054], [55598].
Props hellofromtonya, peterwilsoncc, rarst, costdev, Nick_theGeek, SergeyBiryukov, johnbillion, desrosj, reputeinfosystems, audrasjb, oglekler.
Fixes#57035.
Built from https://develop.svn.wordpress.org/trunk@58923
git-svn-id: http://core.svn.wordpress.org/trunk@58319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As part of determining whether to perform automatic updates, WordPress checks if it is running within a version-controlled environment, recursively looking up the filesystem to the top of the drive, looking for a Subversion, Git, Mercurial, or Bazaar directory, erring on the side of detecting a VCS checkout somewhere.
This commit reuses `WP_Automatic_Updater::is_allowed_dir()` in the Site Health test to avoid a PHP warning if the `open_basedir` directive is in use and any of the directories checked in the process are not allowed:
{{{
is_dir(): open_basedir restriction in effect. File(/.git) is not within the allowed path(s)
}}}
Follow-up to [44986], [55425].
Props Keffr3n, narenin.
Fixes#61834.
Built from https://develop.svn.wordpress.org/trunk@58921
git-svn-id: http://core.svn.wordpress.org/trunk@58317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the assertion for 'errors' being empty when the instance is `WP_Term` and not `WP_Error`. This property exists on `WP_Error`.
This assertion always passed because it was checking a dynamic property on `WP_Term` that does not exist and is not added within Core. Thus, this assertion is not needed and fails with dynamic property deprecations.
Follow-up to [51403], [34646], [29830].
See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58920
git-svn-id: http://core.svn.wordpress.org/trunk@58316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the `unset()` of the `WP_Term::$filter` property within the term tests.
Why?
Prior to the introduction of WP_Term, the term was added to the cache when its filter property was empty. To test the cache, the tests unset this property to trigger `wp_cache_add()` in `get_term()`. [34997] changed that behavior to trigger `wp_cache_add()` when the term was not found after `wp_cache_get()` (i.e. happened in `WP_Term::get_instance()`).
Unsetting the filter property is and was not needed. Prior to `WP_Term`, the condition was an empty value. With `WP_Term`, the filter property is no longer part of the conditional logic for caching.
Follow-up to [34997], [30954], [34035].
See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58919
git-svn-id: http://core.svn.wordpress.org/trunk@58315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Instead of checking for a specific message, e.g. “Item not updated”, the `$_REQUEST['error']` variable is now checked. This allows for custom messages added via the `term_updated_messages` filter to be considered an error when appropriate, and displayed with the correct CSS class.
This also brings consistency with a similar check in `wp-admin/edit-tags.php`.
Follow-up to [31823], [44663].
Props xipasduarte.
Fixes#61896.
Built from https://develop.svn.wordpress.org/trunk@58918
git-svn-id: http://core.svn.wordpress.org/trunk@58314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a z-index to `.media-menu .media-menu-item:focus` to fix the "Upload files" tab's outline on the side next to the other tab.
Follow-up to [57553], [46363].
Props wildworks, antpb, huzaifaalmesbah, krupajnanda, nhrrob, oglekler, rajinsharwar, sabernhardt.
Fixes#60632.
Built from https://develop.svn.wordpress.org/trunk@58917
git-svn-id: http://core.svn.wordpress.org/trunk@58313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The admin image editor crop function introduced rounding errors by using a scaled image to calculate values. Fix uses the image at 100% scale for calculations. Also avoid recalculating selection when the selection position is changed, and prevent incorrect values after scaling or restoration.
Previously committed in [58456] and reverted in [58571]. The revert was due to a misattributed test failure.
Props Jossnaz, johnillo, shailu25, rachelbaker, sudipatel007, joedolson, kevin940726 , andrewserong, hmbashar.
Fixes#32282.
Built from https://develop.svn.wordpress.org/trunk@58915
git-svn-id: http://core.svn.wordpress.org/trunk@58311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.
Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromtonya.
Fixes#61578.
Built from https://develop.svn.wordpress.org/trunk@58914
git-svn-id: http://core.svn.wordpress.org/trunk@58310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp-content/upgrade` directory does not exist initially after installation, so the Site Health check could not determine the available disk space until the directory was subsequently created during an update.
By testing `WP_CONTENT_DIR` instead, the check can complete successfully.
This also brings consistency with similar checks in `_unzip_file_ziparchive()` and `_unzip_file_pclzip()`.
Follow-up to [55720], [56401].
Props wbdv, khokansardar, mi5t4n, SergeyBiryukov.
Fixes#61602.
Built from https://develop.svn.wordpress.org/trunk@58913
git-svn-id: http://core.svn.wordpress.org/trunk@58309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Adding a test for `wp_privacy_send_personal_data_export_email()` to verify the `user_request` post type.
* Reordering some pre-existing tests to check the request ID and post type first.
Follow-up to [43291], [43499], [44535].
Props garrett-eclipse, berubenic.
See #46560.
Built from https://develop.svn.wordpress.org/trunk@58912
git-svn-id: http://core.svn.wordpress.org/trunk@58308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The image block caption was not being centered on mobile. This was set to start at 1000 pixels and wider. This might have been intended to prevent wrapping, but you can resolve this by unselecting alignment.
Props spanglishwebs, sabernhardt, sudipatel007, shailu25.
Fixes#50317.
Built from https://develop.svn.wordpress.org/trunk@58909
git-svn-id: http://core.svn.wordpress.org/trunk@58305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The pullquote block was not reflecting the typography changes. This updated patch keeps the size and also fixes the line height.
Props pranitdugad, nidhidhandhukiya, jorbin, darshitrayaguru97, yurajsinj2211, ankit-k-gupta, poena, sabernhardt, shailu25.
Fixes#59919.
Built from https://develop.svn.wordpress.org/trunk@58907
git-svn-id: http://core.svn.wordpress.org/trunk@58303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This function is only utilized as a `shutdown` action callback, so the return value is not used anywhere.
`wp_trigger_error()` is now used instead under the same conditions.
Follow-up to [55720], [56342].
Props johnbillion, amitraj2203, narenin.
Fixes#61116.
Built from https://develop.svn.wordpress.org/trunk@58906
git-svn-id: http://core.svn.wordpress.org/trunk@58302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a fatal error on PHP 8 if `error_reporting()` is disabled in `php.ini`.
On systems with this function disabled, it's best to add a dummy function to the `wp-config.php` file, as there are multiple other calls in core or plugins.
However, as this call to the function is run prior to `wp-config.php` loading, it is now wrapped in a `function_exists()` check.
Follow-up to [50447].
Props gansbrest, sabernhardt, jrf, martin.krcho, SergeyBiryukov.
Fixes#61873.
Built from https://develop.svn.wordpress.org/trunk@58905
git-svn-id: http://core.svn.wordpress.org/trunk@58301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When providing an incorrect path to preload, the `rest_preload_api_request` will silently fail, and nothing will be preloaded.
* Fix typo for `wp_template_part` post type preload path for the Site Editor.
* Do not preload the `wp_block` post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.
Props kirasong, tyxla, mamaduka.
Fixes#61884.
Built from https://develop.svn.wordpress.org/trunk@58904
git-svn-id: http://core.svn.wordpress.org/trunk@58300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since removing the build steps for a gzipped version of TinyMCE, the check whether gzip is supported on the server is superfluous. It may also result in the uncompressed files being used when the compressed files are available and could be used.
Follow-up to [44114], [44651].
Props MattyRob, hbhalodia.
Fixes#61862.
Built from https://develop.svn.wordpress.org/trunk@58902
git-svn-id: http://core.svn.wordpress.org/trunk@58298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents the GitHub bot from posting a comment on pull requests requesting a trac ticket link if the ticket description includes a link via the Core- prefix, eg Core-61865.
The WordPress/WordPress-Develop repository is configured to automatically convert the text to a trac ticket link.
Props martinkrcho, peterwilsoncc.
Fixes#61865.
Built from https://develop.svn.wordpress.org/trunk@58901
git-svn-id: http://core.svn.wordpress.org/trunk@58297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the name mappings to sort display names ascii-alphabetically and to ascribe commits to updated usernames.
Accounts without a seperate display name remain listed in the footer of the file.
Props dmsnell, jorbin.
See #61864.
Built from https://develop.svn.wordpress.org/trunk@58900
git-svn-id: http://core.svn.wordpress.org/trunk@58296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
From time to time a new commit will appear from an existing commit which has a different name or email address (or both) than an existing name or email address. This occurs because of changing names and changing emails and because of mistakes. Additionally, the `svg`-to-`git` process double-encodes names from `profiles.wordpress.org` causing corruption in names with non-US-ASCII characters.
This patch introduces a `.mailmap` file to alias committers so that:
- All contributions for a given person are shown for that person.
- Committers will be able to control or fix the display of their own name.
The `.mailmap` file is a standard `git` configuration.
Developed in https://github.com/wordpress/wordpress-develop/pull/7180
Discussed in https://core.trac.wordpress.org/ticket/61864Fixes#61864.
Built from https://develop.svn.wordpress.org/trunk@58899
git-svn-id: http://core.svn.wordpress.org/trunk@58295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a regression introduced in [58241] where selectors with pseudo elements are wrapped within `:where()` causing malformed CSS and the CSS rule(s) not being applied.
When processing custom CSS for blocks, this changeset:
* Strips the pseudo-elements from the original nested selector, performs the required wrapping in `:root :where`, then re-appends the pseudo-element selector with its leading combinators if present.
* Removes empty CSS rules.
It includes the PHP changes.
Reference:
* PHP changes from [https://github.com/WordPress/gutenberg/pull/63980 Gutenberg PR 63980].
Follow-up to [58241], [56812], [55216].
Props aaronrobertshaw, wongjn, harlet7, dballari, ramonopoly, andrewserong, aristath, hellofromTonya.
Fixes#61769.
Built from https://develop.svn.wordpress.org/trunk@58896
git-svn-id: http://core.svn.wordpress.org/trunk@58292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes duplicate IDs on the post list admin pages affecting various list items, selects and checkboxes:
* JavaScript duplication of the inline editing HTML for bulk editing renames various IDs to include the prefix `bulk-edit-`,
* IDs in the Category Checkbox Walker make use of `wp_unique_prefixed_id()` to avoid duplicates, resulting in a numeric suffix, and,
* the post parent dropdown for the bulk editor is given a custom ID `bulk_edit_post_parent`.
Props peterwilsoncc, sergeybiryukov, azaozz, joedolson, siliconforks, zodiac1978, rcreators.
Fixes#61014.
Built from https://develop.svn.wordpress.org/trunk@58894
git-svn-id: http://core.svn.wordpress.org/trunk@58290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a regression introduced in [58241] which inadvertently bumped the specificity in a non-iframed editor for `.editor-styles-wrapper .is-layout-flow > *` from (0,1,0) to (0,2,0). This fix restores theme.json spacing rules taking precedence over the implicit spacing rules in a non-iframed editor.
**The What**
When the block editor is not iframed (which can happen when Custom Fields are active, or blocks that use and older `apiVersion` are present), style rules are processed using post css to append the `.editor-styles-wrapper` class name. This has the effect of scoping the the style rules to ensure they don't affect the editor chrome or admin.
With [58241], one of the rules was changed to `.is-layout-flow > *`. In a iframed editor, the specificity of this rule is okay (0,1,0), but in a non-iframed editor it becomes `.editor-styles-wrapper .is-layout-flow > *`, a specificity of (0,2,0). Comparing this to before [58241], the same rule was `.editor-styles-wrapper :where(body .is-layout-flow) > *` (specificity 0,1,0). This is a regression in specificity that has caused some issues. Notably themes can no longer properly override the spacing for blocks using theme.json and have the results correctly shown in the non-iframed editor.
**The How**
This changeset modifies the selector to `:root :where(.is-layout-flow) > *` (still specificity 0,1,0). `transformStyles` handles 'root' selectors a little differently, it'll instead replace the `:root` part so it becomes `.editor-styles-wrapper where(.is-layout-flow) > *` (keeping the specificity at 0,1,0).
The other layout selector that this affects is the `:first-child` `:last-child` selectors that are responsible for resetting margin at the start and end of a block list. They traditionally have a 0,2,0 specificity so that they can override both the above rule and any rules in the theme.json. Those selectors are also maintained at 0,2,0 with this change, they become something like `:root :where(.is-layout-flow) > :first-child`.
**References:**
* PHP changes from [https://github.com/WordPress/gutenberg/pull/64076 Gutenberg PR 64076].
Follow-up to [58241], [58228], [55956], [54162].
Props talldanwp, aaronrobertshaw, andrewserong, markhowellsmead, ramonopoly, hellofromTonya.
Fixes#61829.
Built from https://develop.svn.wordpress.org/trunk@58890
git-svn-id: http://core.svn.wordpress.org/trunk@58286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Only the translatable part not HTML, should appear for translators to avoid issues. This resolves one string that was not appearing. This only fixed for one theme although discussion on the ticket was for multiples. Other tickets should be open for those if desireable.
Props Presskopp, SergeyBiryukov, pratikkry, pento, mukesh27, laurelfulford, kjellr, desrosj, sabernhardt.
Fixes#45473.
Built from https://develop.svn.wordpress.org/trunk@58881
git-svn-id: http://core.svn.wordpress.org/trunk@58277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp_delete_user()` does not actually delete the entire user when using WordPress Multisite. Therefore tests should typically use the test helper method to fully delete the user, unless explicitly ignoring Multisite or testing the `wp_delete_user()` function while taking Multisite behavior into account.
Fixes#61851.
Built from https://develop.svn.wordpress.org/trunk@58876
git-svn-id: http://core.svn.wordpress.org/trunk@58272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This brings the function in line with the similar `get_edit_post_link()` parameter. The 'get_edit_comment_link' filter now additionally receives the `$comment_id` and `$context` as parameters.
Additionally, as a minor enhancement, the capability check is now more defensive, as it will no longer cause an error if the given comment ID is invalid.
As part of the changeset, comprehensive test coverage for the `get_edit_comment_link()` including the new behavior is added.
Props deepakrohilla.
Fixes#61727.
Built from https://develop.svn.wordpress.org/trunk@58875
git-svn-id: http://core.svn.wordpress.org/trunk@58271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When support was added for foreign content, an ambiguity in the HTML specification led to code that followed the wrong path when encountering a self-closing SCRIPT element in the SVG namespace. Further, a fallthrough was discovered during manual testing.
This patch adds a new test to assert the proper behaviors and fixes these issues. In the case of the SCRIPT element, the outcome was the same with the wrong code path, making the defect benign. In the case of the fallthrough, the wrong behavior would occur.
The updates in this patch also resolves a todo relating to the spec ambiguity.
Developed in https://github.com/wordpress/wordpress-develop/pull/7164
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58868].
Props: dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58871
git-svn-id: http://core.svn.wordpress.org/trunk@58267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, `WP_HTML_Processor::expects_closer()` would report `true` for self-closing foreign elements when called without supplying a node in question, but it should have been reporting `true` just as it does for HTML elements.
This patch adds a test case demonstrating the issue and a bugfix.
The `html5lib` test runner was relying on the incorrect behavior, accidentally working. This is also corrected and the `html5lib` test now relies on the correct behavior of `expects_closer()`.
Developed in https://github.com/wordpress/wordpress-develop/pull/7162
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58868].
Props: dmsnell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58870
git-svn-id: http://core.svn.wordpress.org/trunk@58266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As part of work to add more spec support to the HTML API, this patch adds support for SVG and MathML elements, or more generally, "foreign content."
The rules in foreign content are a mix of XML and HTML parsing rules and introduce additional complexity into the processor, but is important in order to avoid getting lost when inside these elements.
This patch follows the first by deleting the empty files, which were mistakenly left in during the initial merge.
Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58867].
Props: dmsnell, jonsurrell, westonruter.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58868
git-svn-id: http://core.svn.wordpress.org/trunk@58264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When `set_modifiable_text()` was added to the Tag Processor, it was considered that the same information could be queried after setting its value and before proceeding to the next token, but unfortunately overlooked that if the starting modifiable text length was zero, then the read in `get_modifiable_text()` would ignore enqueued updates.
In this patch, `get_modifiable_text()` will read any enqueued values before reading from the input HTML document to ensure consistency.
Follow-up to [58829].
Props dmsnell, jonsurrell, ramonopoly.
Fixes#61617.
Built from https://develop.svn.wordpress.org/trunk@58866
git-svn-id: http://core.svn.wordpress.org/trunk@58262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the `whatwg-fetch` library from version `3.6.17` to `3.6.20`, the latest current version.
This library is included and registered within WordPress as the `wp-polyfill-fetch` script but is no longer used by WordPress itself. Updates are provided as a courtesy, and all projects using this polyfill should reevaluate usage.
Props manooweb.
Fixes#60514.
Built from https://develop.svn.wordpress.org/trunk@58860
git-svn-id: http://core.svn.wordpress.org/trunk@58256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Pre-WordPress 6.6, the `body` selector was used for styles associated with the body.
In 6.6, this was mistakenly changed to `:root :where(body)`, an increase in specificity, causing some issues for themes.
This change reverts the specificity increase, styles again use the `body` selector.
Syncs PHP changes from https://github.com/WordPress/gutenberg/pull/63726.
Props talldanwp, andrewserong, aaronrobertshaw, mukesh27, hellofromtonya.
Fixes#61704.
Built from https://develop.svn.wordpress.org/trunk@58856
git-svn-id: http://core.svn.wordpress.org/trunk@58252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the part two in a larger modularization of the data in `WP_Debug_Data`.
Previously this was a single massive method drawing in debug data from various
groups of related data, where the groups were independent from each other.
This patch separates the second of twelve groups, the `wp-constants` info,
into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible
for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/pull/7106
Discussed in https://core.trac.wordpress.org/ticket/61648
Props: apermo, costdev, dmsnell.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@58855
git-svn-id: http://core.svn.wordpress.org/trunk@58251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When inserting a term from a non-existing taxonomy as a nav item, the `post_title` property should be empty, and the function should not throw a fatal error for `wp_specialchars_decode()`.
Includes bringing some consistency to similar checks for post types and post type archives in the same code fragment.
Follow-up to [14283], [14450], [35382], [36095].
Props dd32, narenin, mukesh27, SergeyBiryukov.
Fixes#61799.
Built from https://develop.svn.wordpress.org/trunk@58854
git-svn-id: http://core.svn.wordpress.org/trunk@58250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The grid layout looks different between front and back end due to the float clearing elements being visible in Row and Grid blocks. This moves the hack rather than deletes it.
Props up1512001, sabernhardt, poena.
Fixes#61611.
Built from https://develop.svn.wordpress.org/trunk@58853
git-svn-id: http://core.svn.wordpress.org/trunk@58249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Automatically create a JPEG version of uploaded HEIC images if the server has
a version of Imagick that supports HEIC. Conversion is done silently through
the existing `WP_Image_Editor` infrastructure that creates multiple sizes of
uploaded images.
This allows users to view HEIC images in WP Admin and use them in their posts
and pages regardless of whether their browser supports HEIC. Browser support
for HEIC is relatively low (only Safari) while the occurrence of HEIC images is
relatively common. The original HEIC image can be downloaded via a link on
the attachment page.
Props adamsilverstein, noisysocks, swissspidy, spacedmonkey, peterwilsoncc.
Fixes#53645.
Built from https://develop.svn.wordpress.org/trunk@58849
git-svn-id: http://core.svn.wordpress.org/trunk@58245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the static storing the version number in `wp_get_wp_version()` to ensure the version number is reported correctly after a WordPress upgrade is completed.
Reverts [58827].
Props costdev, SergeyBiryukov, Cybr.
See #61782.
Built from https://develop.svn.wordpress.org/trunk@58848
git-svn-id: http://core.svn.wordpress.org/trunk@58244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves a fatal error if `strict_types` PHP setting is enabled:
{{{
Argument #1 ($num) must be of type float, string given
}}}
Since the goal of the Site Health Info screen is to display raw values where possible, the `number_format()` call here does not seem to provide any benefit.
Props krishneup, sabernhardt, audrasjb, SergeyBiryukov.
Fixes#60364.
Built from https://develop.svn.wordpress.org/trunk@58847
git-svn-id: http://core.svn.wordpress.org/trunk@58243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This replaces an outdated note about the 20 characters limit on the password field in the WordPress database schema.
The `post_password` column was increased to 255 characters in WordPress 4.7.
Follow-up to [27676], [38590].
Props debarghyabanerjee, peterwilsoncc, dd32, mukesh27.
Fixes#61703.
Built from https://develop.svn.wordpress.org/trunk@58846
git-svn-id: http://core.svn.wordpress.org/trunk@58242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the Tag Processor (or HTML Processor) attempts to parse certain
incomplete script tags, the parser enters an infinite loop and will
hang indefinitely. The conditions to reach this situation are:
- Input HTML ends with an open script tag.
- The final character of input is `-` or `<`.
The infinite loop was caused by the parser-advancing increment not being
called when two `||` OR conditions short-circuited. If the first
condition was true, the `$at++` code was never reached.
This path resolves the issue.
Developed in https://github.com/wordpress/wordpress-develop/pull/7128
Discussed in https://core.trac.wordpress.org/ticket/61810
Follow-up to [55203].
Props: dmsnell, jonsurrell.
Fixes#61810.
Built from https://develop.svn.wordpress.org/trunk@58845
git-svn-id: http://core.svn.wordpress.org/trunk@58241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When setting an an attribute value in the HTML API, WordPress may reject
an update based on rules in `kses`. In these cases, the return value from
an escaping function will be an empty string, and the HTML API should
reject the update. Unfortunately, it currently reports that it updates the
attribute but sets an empty string value, which is misleading.
In this patch, the HTML API will refuse the attribute update and return
false to indicate as much when WordPress rejects the updates.
Developed in https://github.com/wordpress/wordpress-develop/pull/7114
Discussed in https://core.trac.wordpress.org/ticket/61719
Follow-up to [58472].
Props: amitraj2203, dmsnell, mukesh27.
Fixes#61719.
Built from https://develop.svn.wordpress.org/trunk@58844
git-svn-id: http://core.svn.wordpress.org/trunk@58240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update `is_wp_version_compatible()` to use `wp_get_wp_version()` introduced in [58813] to ensure the value of `$wp_version` has not been modified by a theme or plugin.
Props costdev, mukesh27, Cybr, sergeybiryukov.
Fixes#61781.
Built from https://develop.svn.wordpress.org/trunk@58843
git-svn-id: http://core.svn.wordpress.org/trunk@58239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For salts generated and stored in the database, use `wp_prime_site_option_caches()` within `wp_salt()` to prime the options in a single database query, down from up to nine database queries.
The options are primed when the corresponding constant is either undefined or uses the default string `put your unique phrase here`.
Props joemcgill, spacedmonkey, peterwilsoncc.
Fixes#59871.
Built from https://develop.svn.wordpress.org/trunk@58837
git-svn-id: http://core.svn.wordpress.org/trunk@58233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The HTML Processor has only supported a specific kind of parsing mode
called _the fragment parsing mode_, where it behaves in the same way
that `node.innerHTML = html` does in the DOM. This mode assumes a
context node and doesn't support parsing an entire document.
As part of work to add more spec support to the HTML API, this patch
introduces a full parsing mode, which can parse a full HTML document
from start to end, including the doctype declaration and head tags.
Developed in https://github.com/wordpress/wordpress-develop/pull/6977
Discussed in https://core.trac.wordpress.org/ticket/61576
Props: dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58836
git-svn-id: http://core.svn.wordpress.org/trunk@58232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces the ability to specify a value for `background.backgroundAttachment` in theme.json styles.
The theme.json value determines the CSS value for the `background-attachment` property.
This feature was introduced into the Gutenberg plugin in version 18.9.
Props andrewserong, mukesh27, noisysocks, ramonopoly.
Fixes#61720
Built from https://develop.svn.wordpress.org/trunk@58834
git-svn-id: http://core.svn.wordpress.org/trunk@58230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the message more accurate by referring to the version of PHP currently recommended by WordPress, not the current version of PHP.
Follow-up to [44986], [46267], [47254].
Props swb1192, psykro, swissspidy, joemcgill, mukesh27, aristath.
See #61623.
Built from https://develop.svn.wordpress.org/trunk@58832
git-svn-id: http://core.svn.wordpress.org/trunk@58228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This patch fixes an oversight from when default metadata values were introduced
in #43941 in WordPress 5.5: metadata updates should persist in the database
even if they match the registered default value (because the default values
can change over time).
Previously, the REST API code was comparing updated values against the value
returned by the default-aware `get_metadata()` method. This meant that if no
value existed in the database, and the default value was supplied to the update,
WordPress would think that the updated value was already persisted and skip
the database call.
Now, the `get_metadata_raw()` method is called for comparing whether or not
a database update is required, fixing the bug.
In this patch both issues are resolved.
Developed in https://github.com/wordpress/wordpress-develop/pull/6782
Discussed in https://core.trac.wordpress.org/ticket/55600
Follow-up to [48402].
Props: dmsnell, kraftner, ramon-fincken.
Fixes#55600.
Built from https://develop.svn.wordpress.org/trunk@58831
git-svn-id: http://core.svn.wordpress.org/trunk@58227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the first part in a larger modularization of the data in `WP_Debug_Data`.
Previously this was a single massive method drawing in debug data from various
groups of related data, where the groups were independent from each other.
This patch separates the first of twelve groups, the `wp-filesystem` info,
into a separate method focused on that data.
This work precedes changes to make the `WP_Debug_Data` class more extensible
for better use by plugin and theme code.
Developed in https://github.com/wordpress/wordpress-develop/pull/7065
Discussed in https://core.trac.wordpress.org/ticket/61648
Props: afragen, apermo, costdev, dmsnell.
See #61648.
Built from https://develop.svn.wordpress.org/trunk@58830
git-svn-id: http://core.svn.wordpress.org/trunk@58226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to optimize performance by saving the return value to a static variable, so that the `version.php` file is not unnecessarily required on each function call.
Follow-up to [58813].
Props Cybr, debarghyabanerjee, mukesh27.
Fixes#61782. See #61627.
Built from https://develop.svn.wordpress.org/trunk@58827
git-svn-id: http://core.svn.wordpress.org/trunk@58223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In some cases, derived state returns an associative array. Directives may wish to continue to access properties of the associative array, when using the syntax `state.arrayReturnedByClosure.property`. This patch continues evaluating the path after the associative array has been returned by the Closure.
Props jonsurrell, luisherranz.
Fixes#61741.
Built from https://develop.svn.wordpress.org/trunk@58825
git-svn-id: http://core.svn.wordpress.org/trunk@58221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The Table block was not reflecting the custom font size on the front. This solution now brings custom font sizes in for front the same as back in the editor.
Props umesh84, SergeyBiryukov, sabernhardt, shailu25.
Fixes#56157.
Built from https://develop.svn.wordpress.org/trunk@58824
git-svn-id: http://core.svn.wordpress.org/trunk@58220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Modifies gravatar image URLs to always use the HTTPS version from secure.gravatar.com.
Gravatar now redirects HTTP image requests to their HTTPS equivalent, resulting in redirects for sites running over an HTTP connection (`is_ssl() === false`). Since the introduction of HTTP/2 the use of sub-domains for different hashes ([1-3].gravatar.com) now represents a performance hinderance rather than improvement.
The scheme passed to `get_avatar_data()` is now ignored for the generation of Gravatar URLs but the setting retained to avoid introducing bugs for sites using either local avatars or third party providers.
Props neoxx, SergeyBiryukov, sippis, peterwilsoncc, mukesh27, costdev, dd32.
Fixes#37454.
Built from https://develop.svn.wordpress.org/trunk@58822
git-svn-id: http://core.svn.wordpress.org/trunk@58218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows for more flexibility in modifying how feed links are displayed by the `feed_links()` and `feed_links_extra()` functions, including, for example, a way to change the `»` separator to something else.
Follow-up to [10377], [33838], [33839], [53125], [54161].
Props topdownjimmy, tw2113, williampatton.
Fixes#43225.
Built from https://develop.svn.wordpress.org/trunk@58821
git-svn-id: http://core.svn.wordpress.org/trunk@58217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes adding a custom font size to a Calendar and Table block. This was only an issue for custom font size entering.
Props nidhidhandhukiya, yurajsinj2211, ankit-k-gupta, anveshika, sabernhardt, darshitrajyaguru97, shailu25, umesh84, SergeyBiryukov.
Fixes#59996, #56157.
Built from https://develop.svn.wordpress.org/trunk@58819
git-svn-id: http://core.svn.wordpress.org/trunk@58215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves the Code block not changing when the font sizes are switched in Twenty Eleven and Twenty Twelve. The solution is the same as used for other code block adjustments for font sizes.
Props viralsampat, sabernhardt.
Fixes#61753.
Built from https://develop.svn.wordpress.org/trunk@58816
git-svn-id: http://core.svn.wordpress.org/trunk@58212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces `wp_get_wp_version()` to get an unmodified value of `$wp_version` from `wp-includes/version.php`. Some plugins modify the global in an attempt to improve security through obscurity. This practice can cause errors in WordPress so the ability to get an unmodified version is needed.
Replaces instances within the code base in which `version.php` was required in order to get an unmodified value. `script-loader.php` is intentionally excluded from the replacements as the function is not always available to the file.
Props debarghyabanerjee, afragen, costdev.
See #61627.
Built from https://develop.svn.wordpress.org/trunk@58813
git-svn-id: http://core.svn.wordpress.org/trunk@58209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that the arguments are correctly interpreted when passed as a query string, i.e. when `wp_parse_args()` is involved. For example, `wp_list_pages( 'depth=0' )` should display a list of all pages to the maximum depth.
Follow-up to [57848].
Props freibergergarcia, peterwilsoncc, ahortin.
Fixes#61749.
Built from https://develop.svn.wordpress.org/trunk@58812
git-svn-id: http://core.svn.wordpress.org/trunk@58208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Modifies the caching of `notoptions` in `delete_network_option()` to ensure that the network cache is bypassed on single site installs.
On single site installs the incorrect caching was causing the `notoptions` cache to remain populated once a deleted option was subsequently added or updated.
Follow up to [58782].
Props bjorsch, pbearne.
Fixes#61730.
See #61484.
Built from https://develop.svn.wordpress.org/trunk@58811
git-svn-id: http://core.svn.wordpress.org/trunk@58207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replace links to en.gravatar.com with links to gravatar.com as the english site now uses the base domain. This avoids an unnecessary redirect for english language sites.
The links remain translatable for non-english versions of WordPress.
Props narenin, knutsp.
Fixes#61424.
Built from https://develop.svn.wordpress.org/trunk@58810
git-svn-id: http://core.svn.wordpress.org/trunk@58206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to resolve a fatal error when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` property defined, or if it's empty:
{{{
Object of class WP_Comment could not be converted to string
}}}
This commit mirrors the changes previously made for a similar code fragment in `get_comment_author()`.
Includes:
* Unit tests to demonstrate the fatal error and validate the fix.
* Changing the default value for a non-existent comment ID in `get_comment_author()` from an empty string to zero as a numeric string, for consistency with `get_comment_ID()`.
Follow-up to [52818], [55289], [58335], [58755].
Props narenin, mukesh27, iflairwebtechnologies, umeshsinghin, SergeyBiryukov.
Fixes#61715.
Built from https://develop.svn.wordpress.org/trunk@58809
git-svn-id: http://core.svn.wordpress.org/trunk@58205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.
The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.
Follow-up to [58069], [34269], [29026], [21028].
Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes#61561.
Built from https://develop.svn.wordpress.org/trunk@58804
git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the `variations` field in a block.json file could be used to provide a static list of the block's variations (i.e., an array). Alternatively, the block's `variation_callback` could be set during server-side block registration to point to a PHP function to generate those variations.
This changeset makes it so that the block.json `variations` field can be alternatively set to a string, which will be interpreted as the filename of a PHP file that generates the variations.
It is loosely modeled after [54132], which introduced the `render` field for `block.json`, as a way to point to a PHP file instead of providing a `render_callback`.
Props bernhard-reiter, gziolo.
Fixes#61280.
Built from https://develop.svn.wordpress.org/trunk@58801
git-svn-id: http://core.svn.wordpress.org/trunk@58197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the `regenerator-runtime` library to version `0.14.1`.
This library has not been used by Core itself in quite a while and only maintained as a courtesy. Any projects relying on `regenerator-runtime` should reevaluate their usage.
Props manooweb.
Fixes#60515.
Built from https://develop.svn.wordpress.org/trunk@58800
git-svn-id: http://core.svn.wordpress.org/trunk@58196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves the border not also aligning with the quote block. When this theme was built the editor used style attributes for text alignment. This patch updates existing rules for center and right aligned quote blocks.
Props viralsampat, poena, sabernhardt.
Fixes#61132.
Built from https://develop.svn.wordpress.org/trunk@58796
git-svn-id: http://core.svn.wordpress.org/trunk@58192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The following third-party actions have been updated to their latest versions.
- `shivammathur/setup-php` from `2.30.0` to `2.31.1`.
- `actions/setup-node` from `4.0.2` to `4.0.3`.
- `actions/cache` from `4.0.1` to `4.0.2`.
- `actions/upload-artifact` from `4.3.1` to `4.3.4`.
- `slackapi/slack-github-action` from `1.25.0` to `1.26.0`.
- `codecov/codecov-action` from `4.1.0` to `4.5.0`.
See #61564.
Built from https://develop.svn.wordpress.org/trunk@58789
git-svn-id: http://core.svn.wordpress.org/trunk@58191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `inject_ignored_hooked_blocks_metadata_attributes` filter that is attached to both the `rest_pre_insert_wp_template` and `rest_pre_insert_wp_template_part` hooks receives a `stdClass` object from the Templates REST API controller that contains all fields that the client would like to modify when making a `POST` request (plus the `id` to identify the relevant template or template part, respectively).
There are cases when the `post_content` field is not set, e.g. when the client would like to rename an existing template (in which case it would only set the `title` field).
Prior to this changeset, the filter would erroneously apply the Block Hooks algorithm to the non-existent `post_content` field regardless, which would result in it being set to the empty string `''`. As a consequence, renaming a template would have the unwanted side effect of wiping its contents.
This changeset fixes the issue by returning early from the filter if the `post_content` field is not set.
Props alshakero, bernhard-reiter.
Fixes#61550.
Built from https://develop.svn.wordpress.org/trunk@58785
git-svn-id: http://core.svn.wordpress.org/trunk@58187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves the seperator block color settings ordering. They were displaying incorrectly due to ruleset problems. This edits the order for the front end also.
Props bhaveshdesai13, aniketpatel, miguelaxcar, nidhidhandhukiya, poena, pavanpatil1, sabernhardr.
Fixes#57544.
Built from https://develop.svn.wordpress.org/trunk@58784
git-svn-id: http://core.svn.wordpress.org/trunk@58186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using the /posts or /pages endpoints, for private posts or pages, you get the following title property: { raw: "Some title", rendered: "Private: Some title" }
this commit removes the prefix from rendered private posts titles (just like what we do for protected posts)
Props youknowriad, swissspidy, timothyblynjacobs, sergeybiryukov, ramonopoly.
Fixes#61639.
Built from https://develop.svn.wordpress.org/trunk@58783
git-svn-id: http://core.svn.wordpress.org/trunk@58185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prime the `notoptions` cache within `delete_option` and `delete_network_option` to avoid the need for a database query if `get_option` or `get_network_option` is subsequently called.
Adds some associated tests to ensure that an option is cleared from the notoptions cache when an option is added either via `add_option`, `update_option` or their network option equivalent.
Props pbearne, mukesh27.
Fixes#61484.
Built from https://develop.svn.wordpress.org/trunk@58782
git-svn-id: http://core.svn.wordpress.org/trunk@58184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Insertion modes in an HTML parser may include instructions like "process
the token in the IN HEAD insertion mode." The rules do not change the
insertion mode of the parser, but the errors are triggered outside of the
rules for the current insertion mode. These will be misleading when
bailing on these instructions, because it will point someone to the wrong
place in the code to find the source of the error.
In this patch all of the bail-points due to lacking insertion mode support
are hard-coded to better orient someone to the section of the code lacking
support for handling the input HTML.
Developed in https://github.com/wordpress/wordpress-develop/pull/7043
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58679].
Props: dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58781
git-svn-id: http://core.svn.wordpress.org/trunk@58183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When support was added for the remaining tags in the IN BODY insertion mode, a test
file indicating that support was necessary for certain parts of the parser was
removed, but it wasn't removed from SVN when sending over the patch from `git`.
This patch removes that empty file so that the WPCS workflows pass.
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58779].
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58780
git-svn-id: http://core.svn.wordpress.org/trunk@58182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the screen is smaller the edit buttons are obscured. This resolves that problem for the smaller screens and only targets the container for footer navigation and widgets.
Props sumitsingh, SergeyBiryukov, sabernhardt.
Fixes#49008.
Built from https://develop.svn.wordpress.org/trunk@58778
git-svn-id: http://core.svn.wordpress.org/trunk@58180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the font size is changed the border on the front was changing in width. This fix resolves that to make sure the width does not adjust.
Props nidhidhandhukiya, sabernhardt, kamran8176, pitamdey, shailu25.
Fixes#60239.
Built from https://develop.svn.wordpress.org/trunk@58777
git-svn-id: http://core.svn.wordpress.org/trunk@58179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Whilst initially this could be thought to be solved in Jetpack due to submenus only having a z-index of 1 a fix is desirable. This brings in the suggested value.
Props robertghetau, SergeyBiryukov, sabernhardt, poena, narenin.
Fixes#55892.
Built from https://develop.svn.wordpress.org/trunk@58776
git-svn-id: http://core.svn.wordpress.org/trunk@58178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
We tried moving away from the deprecated React UMD builds previously,
the problem we faced is that there's a warning that is triggered on the console because we're not using a separate impact for `createRoot`.
This warning has been removed in React 19 along with the removal of the UMD builds, so we should be able to revert this commit when we upgrade to React 19 but for now, we need to restore the usage of the umd builds.
Props mamaduka.
See #61324.
Built from https://develop.svn.wordpress.org/trunk@58775
git-svn-id: http://core.svn.wordpress.org/trunk@58177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The function twentysixteen_entry_meta included screen reader text inside the span property using the author mf class. This resolves that in both Twenty Sixteen and Twenty Fifteen. It should have the screen reader text inside the byline span but outside the author vcard span.
Props dshanske, laurelfulford, sabernhardt, shilu25.
Fixes#46233.
Built from https://develop.svn.wordpress.org/trunk@58771
git-svn-id: http://core.svn.wordpress.org/trunk@58173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `workflow_dispatch` event payload does not contain the `before` property containing the previous commit’s SHA value, which causes scheduled runs of the performance testing workflow in older branches to fail.
This adds a step specifically for this event type to use native Git commands to retrieve the required SHA value instead.
Props joemcgill.
Fixes#61699.
Built from https://develop.svn.wordpress.org/trunk@58767
git-svn-id: http://core.svn.wordpress.org/trunk@58169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
#61182 introduced is_utf8_charset() as a way of standardizing checks for charset slugs referring to UTF-8. This is called by _mb_strlen() inside of compat.php, but is_utf8_charset() is defined in functions.php, which isn't loaded early on. Code calling mb_strlen() early on before functions.php loads in hosts without the multibyte extension therefore may crash.
Props dmsnell, jonsurrell, joemcgill, jorbin.
Fixes#61681.
Built from https://develop.svn.wordpress.org/trunk@58763
git-svn-id: http://core.svn.wordpress.org/trunk@58165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[58335] introduced `(string)` type casting of the passed in `$comment_id` value. If `$comment_id` is a scalar, it works as expected. But if it's an `object`, the following fatal error is thrown:
{{{
Object of class WP_Comment could not be converted to string
}}}
This fatal error happens when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` (empty).
This changeset adds tests to demonstrate the fatal error and validate the fix.
It fixes the fatal error by restructuring the ternary checks into an `if/elseif/else` structure for the 3 paths:
- When `$comment->comment_ID` is not empty, then it uses the property.
- When `$comment_id` is scalar, then it type casts it to a `string`.
- Else, the default is an empty `string`.
Follow-up to [58335], [41127], [52818].
Props ambrosiawt, hellofromTonya, jorbin, mukesh27, SergeyBiryukov.
Fixes#61681.
Built from https://develop.svn.wordpress.org/trunk@58755
git-svn-id: http://core.svn.wordpress.org/trunk@58157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prior to WordPress 6.4, performance testing was performed using Puppeteer instead of Playwright (converted in [56926]). Because of the flaky nature of the workflow using Puppeteer, it was not converted to the reusable pattern implemented through #61213. It was instead removed from 6.2 and 6.3 in [58301] and [58330], respectively.
This removes the workflow for these branches from the strategy matrix when testing old branches to avoid errors and adds an expanded note about why those branches are missing.
See #61213, #61564.
Built from https://develop.svn.wordpress.org/trunk@58754
git-svn-id: http://core.svn.wordpress.org/trunk@58156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Following [58215], admin bar items in the `top-secondary` group have a changed visual order. Increase the priority of the user and recovery menu items so nodes added with higher priorities will still be shown visually before the user and recovery menu items, as they were prior to 58215.
The items will appear in the reverse of the previous order, but the new order now matches their priority order, rather than being the opposite.
Props sabernhardt, joemcgill, pbiron, joedolson.
Fixes#61615.
Built from https://develop.svn.wordpress.org/trunk@58748
git-svn-id: http://core.svn.wordpress.org/trunk@58150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The CSS to make menu item containers resizable in the admin menu editor was too broadly scoped, and caused classic editor metaboxes to have unconstrained height. Limit the scope of the CSS changes to only impact menu item containers.
Props neotrope, sabernhardt, joedolson.
Fixes#61662.
Built from https://develop.svn.wordpress.org/trunk@58747
git-svn-id: http://core.svn.wordpress.org/trunk@58149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In part of a larger review of CSS semantics and behaviors, this patch
takes the opportunity to remove leading whitespace in an updated class
attribute after the first class in the attribute has been removed.
Previously, if the first class name had been removed, the whitespace
that formerly followed it would remain in the class attribute. This
stood in contrast to removing other class names, which removed their
associated whitespace.
There should be no semantic or functional changes in this patch, only
a slightly-large diff for modified HTML documents that looks prettier
when removing the first class name in a class attribute.
Developed in https://github.com/WordPress/wordpress-develop/pull/6933
Discussed in https://core.trac.wordpress.org/ticket/61531
Props dmsnell, jonsurrell.
See #61531.
Built from https://develop.svn.wordpress.org/trunk@58740
git-svn-id: http://core.svn.wordpress.org/trunk@58142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Refactors the following tests to use a data provider with named test cases:
* `test_wp_interactivity_data_wp_context_with_different_arrays()`
* `test_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace()`
* `test_wp_interactivity_data_wp_context_with_json_flags()`
This is better as:
1. One failing test will not block the other tests from running.
2. Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
3. The test no longer contains multiple assertions.
3. It makes it more straight forward to add additional tests.
Follow-up to [58594], [58234], [57762], [57743], [57742], [57563].
Props jrf.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@58739
git-svn-id: http://core.svn.wordpress.org/trunk@58141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Once the `test_process_directives_when_block_is_filtered()` method has run, the named `test_render_block_data()` function declared nested within becomes part of the global namespace, which could cause problems for other tests.
Quite apart from the fact that the name starting with `test_` is confusing (as methods prefixed with `test_` are supposed to be test methods to be run by PHPUnit).
Using a closure for this callback fixes the issue. Declared as `static` for a micro-optimization.
Follow-up to [57826].
Props jrf, hellofromTonya.
See #61530.
Built from https://develop.svn.wordpress.org/trunk@58738
git-svn-id: http://core.svn.wordpress.org/trunk@58140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changeset [58712] introduced the following compile time PHP deprecation notice on >= PHP 8.2 test runs:
{{{
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.
}}}
The `${` syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.
Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
Follow-up to [58712].
Props jrf.
See #61530, #59654, #61576.
Built from https://develop.svn.wordpress.org/trunk@58733
git-svn-id: http://core.svn.wordpress.org/trunk@58135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The font family was not showing correctly for the verse block. The approach taken was to match the front end and this involved also removing the styles in [50358].
Props pranitdugad, sabernhardt, poena, pitamdey.
Fixes#61140.
Built from https://develop.svn.wordpress.org/trunk@58731
git-svn-id: http://core.svn.wordpress.org/trunk@58133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The border was not changing color when it was changed. This brings that in. It is worth noting the original theme design did not have this but as noted in the ticket this has been in the quote block for about two years so matching the current block styling in this case makes sense.
Props umesh84, desrosj, sabernhardt.
Fixes#56565.
Built from https://develop.svn.wordpress.org/trunk@58728
git-svn-id: http://core.svn.wordpress.org/trunk@58130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The button block had issues with font styling not applying. This not only brings letter-spacing but also line-height, text-transform and font-weight to wp-button-block-buttons. [57300] fixed the separator issue. This fix also added box-shadow none for consistency.
Props darshitrajyaguru97, harshgajipara, shailu25, sabernhardt, alvitazwar052.
Fixes#58609.
Built from https://develop.svn.wordpress.org/trunk@58725
git-svn-id: http://core.svn.wordpress.org/trunk@58127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `$single` parameter is passed via the `get_post_metadata` filter and has no default value.
Includes minor code layout fixes for consistency with the formatting of other long conditionals in core.
Follow-up to [56714].
Props rodrigosprimo.
Fixes#61645.
Built from https://develop.svn.wordpress.org/trunk@58717
git-svn-id: http://core.svn.wordpress.org/trunk@58119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This addresses a discrepancy where using `unlink()` allows for checking if it was successful via the return value, but `wp_delete_file()` did not have a return value, making it impossible to verify the result without doing overhead checks if the file still exists.
This also brings more consistency with the other `wp_delete_*()` functions, specifically:
* `wp_delete_file_from_directory()`
* `wp_delete_post()`
* `wp_delete_post_revision()`
* `wp_delete_attachment()`
* `wp_delete_attachment_files()`
* `wp_delete_comment()`
* `wp_delete_nav_menu()`
* `wp_delete_term()`
* `wp_delete_site()`
* `wp_delete_user()`
Includes adding basic unit tests for `wp_delete_file()`.
Follow-up to [31575].
Props bedas, debarghyabanerjee, mukesh27, SergeyBiryukov.
Fixes#61590.
Built from https://develop.svn.wordpress.org/trunk@58715
git-svn-id: http://core.svn.wordpress.org/trunk@58117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The HTML Processor internally throws an exception when it reaches HTML
that it knows it cannot process, but this exception is not made
available to calling code. It can be useful to extract more knowledge
about why it gave up, especially for debugging purposes.
In this patch, more context is added to the WP_HTML_Unsupported_Exception
and the last exception is made available to calling code through a new
method, `get_unsupported_exception()`.
Developed in https://github.com/WordPress/wordpress-develop/pull/6985
Discussed in https://core.trac.wordpress.org/ticket/61646
Props bernhard-reiter, dmsnell, jonsurrell.
See #61646.
Built from https://develop.svn.wordpress.org/trunk@58714
git-svn-id: http://core.svn.wordpress.org/trunk@58116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since the HTML Processor started visiting all nodes in a document, both
real and virtual, the breadcrumb accounting became a bit complicated
and it's not entirely clear that it is fully reliable.
In this patch the breadcrumbs are rebuilt separately from the stack of
open elements in order to eliminate the problem of the stateful stack
interactions and the post-hoc event queue.
Breadcrumbs are greatly simplified as a result, and more verifiably
correct, in this construction.
Developed in https://github.com/WordPress/wordpress-develop/pull/6981
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58590].
Props bernhard-reiter, dmsnell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58713
git-svn-id: http://core.svn.wordpress.org/trunk@58115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Many tests from the html5lib test suite fail because of differences in
text handling between a DOM API and the HTML API, even though the
semantics of the parse are equivalent. For example, it's possible in
the HTML API to read multiple successive text nodes when the tokens
between them are ignored.
The test suite didn't account for this and so was failing tests. This
patch improves the construction of the representation to compare
against the test suite so that those tests don't fail inaccurately.
Developed in https://github.com/WordPress/wordpress-develop/pull/6984
Discussed in https://core.trac.wordpress.org/ticket/61576
Props bernhard-reiter, dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58712
git-svn-id: http://core.svn.wordpress.org/trunk@58114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a fail-safe to return an empty string should the `switch` ever fall through without returning.
Currently, `WP_REST_Templates_Controller::get_wp_templates_author_text_field()` is tightly coupled to `WP_REST_Templates_Controller::get_wp_templates_original_source_field()`. However, if the `$original_source` values change in either method, but not both, it is possible a `void` or `null` will be returned, rather than a `string`.
Follow-up to [57366].
Props antonvlasenko, hellofromTonya, debarghyabanerjee.
Fixes#61580.
Built from https://develop.svn.wordpress.org/trunk@58705
git-svn-id: http://core.svn.wordpress.org/trunk@58107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Pullquote spacings wasn't reflected on front when using border settings. This caused double borders which was due to styling but this was done before optional borders were implemented. The pull request chosen presumes when you have an external border you no longer want the internal one but does look visually better.
Props nidhidhandhukiya, huzaifaalmesbah, poena, sabernhardt.
Fixes#59754.
Built from https://develop.svn.wordpress.org/trunk@58689
git-svn-id: http://core.svn.wordpress.org/trunk@58091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If you have a published page set to a section but also private, draft, pending or trash at some point in the future it was still showing on the homepage. There was no clarity to the user what was happening. This adds in a check to the post_status variable before displaying panel content and adjusts the customizer to show a placeholder if the page is draft,trashed,deleted.
Props brettshumaker, sabernhardt.
Fixes#46604.
Built from https://develop.svn.wordpress.org/trunk@58687
git-svn-id: http://core.svn.wordpress.org/trunk@58089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There were multiple discrepancies between the editor and front end with [58399] matched incorrect border color due to specificity. This resolves that and also includes issues not caught in [60293]. The full list of what this does is in ticket but a summary is reduces specificity for table cell border, removes border color rules, replaces selectors and adds wrapper so alignment changes within the iframe.
Props sabernhardt.
Fixes#61563.
Built from https://develop.svn.wordpress.org/trunk@58686
git-svn-id: http://core.svn.wordpress.org/trunk@58088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit reverts the code to the code from before the bug fix related to PHP 5.2.6–5.2.17.
As support for PHP 5.2 has been dropped, the workaround for the PHP 5.2 bug is no longer needed.
Follow-up to [38015], [38017], [44950], [45058], [57985], [58678], [58682].
Props jrf, ayeshrajans.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58683
git-svn-id: http://core.svn.wordpress.org/trunk@58085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit:
* Removes various comments referencing PHP versions which are no longer supported.
* Removes various comments containing “hints” of things to do after a particular PHP version drop. These hints are incorrect/not actionable for various reasons, so have no value:
* Even though a function could be turned into a closure, removing the function would be a backward compatibility break which is not acceptable, so this suggestion is not actionable.
* Short ternaries are forbidden by the coding standard exactly to prevent the faulty code suggested in the comment from getting into the codebase.
Follow-up to [1243/tests], [6543], [11816], [29861], [29864], [34928], [35369], [36698], [38694], [50786], [58678].
Props jrf, ayeshrajans.
See #61574.
Built from https://develop.svn.wordpress.org/trunk@58682
git-svn-id: http://core.svn.wordpress.org/trunk@58084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When WordPress sends out a password-reset or new-user email, it generates
a link for someone to follow in order to take them to the reset page. If
the user login name ends in a period, however, that generated URL will
end in a period and many email clients will confuse it with a
sentence-ending period instead of being part of the query arguments.
In this patch, the generated URL's query argument are rearranged so that
the link will never end in a period. Alternative ideas were explored to
create a new function to escape URL-ending periods, but this patch resolves
the reported problem without raising any further architectural questions.
Developed in https://github.com/WordPress/wordpress-develop/pull/6834
Discussed in https://core.trac.wordpress.org/ticket/42957
Props audrasjb, costdev, daveagp, dmsnell, hellofromTonya, markparnell, mukesh27, nhrrob, obrienlabs, paulcline.
Fixes#42957.
Built from https://develop.svn.wordpress.org/trunk@58674
git-svn-id: http://core.svn.wordpress.org/trunk@58076 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 [56082].
See #61573.
Built from https://develop.svn.wordpress.org/trunk@58673
git-svn-id: http://core.svn.wordpress.org/trunk@58075 1a063a9b-81f0-0310-95a4-ce76da25c4cd