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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58952 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58951 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58950 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58945 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@58936 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58935 602fd350-edb4-49c9-b593-d223f7449a82
`_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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58932 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58928 602fd350-edb4-49c9-b593-d223f7449a82
This patch adds until-now missing code to parse the structure of HTML DOCTYPE declarations. The DOCTYPE is mostly unused but can dictate the document compatability mode, which governs whether CSS class names match in a ASCII-case-insensitive way or not, and whether TABLE elements close an open P element.
The DOCTYPE information is made available through a new method on the Tag Processor, `get_doctype_info()`.
Developed in https://github.com/wordpress/wordpress-develop/pull/7195
Discussed in https://core.trac.wordpress.org/ticket/61576
Props dmsnell, jonsurrell.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58925 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58923 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58920 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58919 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58912 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58896 602fd350-edb4-49c9-b593-d223f7449a82
An optimization pass on the HTML API left a bug in the `matches()`
method, whereby it would falsely detect a tag name match if the
found tag were a lexical subset of the requested tag. This occurred
because of the use of `substr_compare()` without checking that the
outer lengths matched.
This patch resolves the bug by adding the length check.
Developed in https://github.com/wordpress/wordpress-develop/pull/7189
Discussed in https://core.trac.wordpress.org/ticket/61545
Follow-up to [58613].
Props dmsnell, westonruter.
See #61545.
git-svn-id: https://develop.svn.wordpress.org/trunk@58893 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58890 602fd350-edb4-49c9-b593-d223f7449a82
`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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58876 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58875 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58871 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58870 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58868 602fd350-edb4-49c9-b593-d223f7449a82
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.
Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576
Props: dmsnell, jonsurrell, westonruter.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58867 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58866 602fd350-edb4-49c9-b593-d223f7449a82
Previously the `html5lib` tests have only run in the fragment parser mode,
assuming IN BODY context. This limited the number of tests which could run
and was a result of the HTML Processor only supporting the IN BODY fragment
parser. In [58836], however, a full parser was added to the HTML Processor.
In this patch the full parser is utilized in order to run more of the
previously-skipped tests, asserting more behaviors in the HTML parsing.
Developed in https://github.com/wordpress/wordpress-develop/pull/7117
Discussed in https://core.trac.wordpress.org/ticket/61646
Props: dmsnell, jonsurrell.
See #61646.
git-svn-id: https://develop.svn.wordpress.org/trunk@58859 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58856 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58854 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58849 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58845 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58843 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58836 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@58834 602fd350-edb4-49c9-b593-d223f7449a82
As part of work to add more spec support to the HTML API, this patch adds
support for the IN TEMPLATE and IN HEAD insertion modes. These changes are
primarily about adding support for TEMPLATE elements in the HTML Processor,
but include support for other tags commonly found in the document head, such
as LINK, META, SCRIPT, STYLE, and TITLE.
Developed in https://github.com/wordpress/wordpress-develop/pull/7046
Discussed in https://core.trac.wordpress.org/ticket/61576
Props: dmsnell, jonsurrell, westonruter.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58833 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58831 602fd350-edb4-49c9-b593-d223f7449a82
This patch introduces a new method, `set_modifiable_text()` to the
Tag Processor, which makes it possible and safe to replace text nodes
within an HTML document, performing the appropriate escaping.
This method can be used in conjunction with other code to modify the
text content of a document, and can be used for transforming HTML
in a streaming fashion.
Developed in https://github.com/wordpress/wordpress-develop/pull/7007
Discussed in https://core.trac.wordpress.org/ticket/61617
Props: dmsnell, gziolo, zieladam.
Fixes#61617.
git-svn-id: https://develop.svn.wordpress.org/trunk@58829 602fd350-edb4-49c9-b593-d223f7449a82
When the model of breadcrumb generation in the HTML Processor and node
traversal was simplified, the change introduced a bug whereby unclosed
nodes at the end of a document would remain unvisited and unclosed.
In this patch, a fix is applied to ensure that all open elements close
while traversing a document. A couple of minor documentation typos are
fixed in the patch as well.
Developed in https://github.com/wordpress/wordpress-develop/pull/7085
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58713].
Props: dmsnell, gziolo, jonsurrell.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58828 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58825 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58822 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58813 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58812 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58811 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58809 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@58801 602fd350-edb4-49c9-b593-d223f7449a82