This makes its signature more correct by implementing the spread operator, and adjusts the internal logic correspondingly without affecting performance.
Props jrf, SergeyBiryukov, davidbaumwald, mauriac, johnbillion
Fixes#53218
git-svn-id: https://develop.svn.wordpress.org/trunk@52952 602fd350-edb4-49c9-b593-d223f7449a82
When using an Input Method Editor(IME), pressing escape to perform actions in the IME is common. However, if this was done while replying to a comment, the "close on escape" feature was also triggered which cleared the current textarea and closed it.
This change checks if an IME is in use by binding the `compositionstart` event to the reply text box and setting a flag if it's triggered. The "close on escape" feature will now only be triggered if this new flag is not set after typing a reply.
Props BettyJJ, sabernhardt, alexstine, konradyoast, audrasjb, rafiahmedd, afercia.
Fixes#54548.
git-svn-id: https://develop.svn.wordpress.org/trunk@52951 602fd350-edb4-49c9-b593-d223f7449a82
Similar to the existing `post_date_column_time` filter in the posts list table, this change adds a new hook to filter the "Date" column output in the media list view.
Props ivanlutrov, lopo, audrasjb.
Fixes#42942.
git-svn-id: https://develop.svn.wordpress.org/trunk@52950 602fd350-edb4-49c9-b593-d223f7449a82
This brings consistency with how screenshots are escaped elsewhere.
Follow-up to [52020], [52947].
See #53370.
git-svn-id: https://develop.svn.wordpress.org/trunk@52949 602fd350-edb4-49c9-b593-d223f7449a82
This change appends the theme version number to the URL of screenshots that appear in various place of the WordPress Admin. As a result, browsers will be able to refresh the screenshot as needed when the theme is updated.
Props codente, desrosj, audrasjb, SergeyBiryukov.
Fixes#53370.
git-svn-id: https://develop.svn.wordpress.org/trunk@52947 602fd350-edb4-49c9-b593-d223f7449a82
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.
This commit renames the `$object` variable in `Custom_Image_Header` class methods to `$attachment` for clarity and consistency, as the variable type is actually an array, and updates the documentation accordingly.
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
git-svn-id: https://develop.svn.wordpress.org/trunk@52946 602fd350-edb4-49c9-b593-d223f7449a82
Use the pointer cursor when hovering over the theme details button for consistency with the theme card. Clicking in either area performs the same action.
Props multidots1896, rehanali, ravipatel, sabernhardt, ryokuhi.
Fixes#54971.
git-svn-id: https://develop.svn.wordpress.org/trunk@52944 602fd350-edb4-49c9-b593-d223f7449a82
Add the optional `blockTypes` argument in the patten properties for `WP_Block_Patterns_Registry::register()`.
Props vlad.olaru.
Fixes#55303.
See #54729.
git-svn-id: https://develop.svn.wordpress.org/trunk@52943 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new `WP_Block_Editor_Context::$name` and field. This allows plugin
developers to tell which block editor is being loaded when using filters such as
`allowed_block_types_all` and `block_editor_rest_api_preload_paths`.
Fixes#55301.
Props talldanwp, gziolo, andraganescu.
git-svn-id: https://develop.svn.wordpress.org/trunk@52942 602fd350-edb4-49c9-b593-d223f7449a82
This removes the requirement for block themes to have an unused `index.php` template just for activation, as they use a `templates/index.html` file instead.
The updated requirements are as follows:
* Standalone themes need to have a `templates/index.html` or `index.php` template file.
* Child themes need to have a `Template` header in the `style.css` stylesheet.
Follow-up to [52069], [52247].
Props poena, sabbirshouvo, scruffian, manfcarlo, overclokk, andraganescu, SergeyBiryukov.
Fixes#54272.
git-svn-id: https://develop.svn.wordpress.org/trunk@52940 602fd350-edb4-49c9-b593-d223f7449a82
Both CSS and JS URLs were totally broken for some of the newer blocks (e.g. the navigation block in the 2022 theme) when WP core is outside of the current directory using a different prefix.
Props pgpagely, Mamaduka.
Fixes#55311.
git-svn-id: https://develop.svn.wordpress.org/trunk@52939 602fd350-edb4-49c9-b593-d223f7449a82
Test `wp_set_term_objects()` using terms with special characters in the name, for example ampersand, bullet and other symbols and punctuation.
Props kapacity, costdev.
Fixes#53152.
See #54725.
git-svn-id: https://develop.svn.wordpress.org/trunk@52938 602fd350-edb4-49c9-b593-d223f7449a82
For `wp.i18n` the library [https://github.com/messageformat/Jed Jed] was initially used which was throwing an error if a domain was not registered but used in a translate function. Later, the library was replaced by [https://github.com/aduth/tannin Tannin] which no longer requires the domain to be registered and thus we can avoid printing an empty-ish translations script that doesn't add any translations.
Props jsnajdr.
Fixes#55250.
git-svn-id: https://develop.svn.wordpress.org/trunk@52937 602fd350-edb4-49c9-b593-d223f7449a82
This brings some consistency to how the introduction is displayed for the Beta Testing, Featured, and Recommended tabs of the Add Plugins screen.
This commit also reorders the `switch` cases for the text in the same order as they are displayed.
Follow-up to [9141], [30889], [36297].
Props sabbir1991, kapilpaul.
Fixes#55389.
git-svn-id: https://develop.svn.wordpress.org/trunk@52936 602fd350-edb4-49c9-b593-d223f7449a82
A new function `wp_filesize()` was added with [52837]. The function lived in the `wp-admin/includes/file.php` file. However, this admin specific function is not loaded into memory when hitting `media/edit` endpoint. The result was a `500` Internal Server Error. Why? The function is invoked with that endpoint, but the function does not exist in memory.
This commit relocates the new function to the `wp-includes/functions.php` file. In doing so, the function is available for both the frontend and backend.
Follow-up to [52837].
Props talldanwp, spacedmonkey, costdev, antonvlasenko.
Fixes#55367.
git-svn-id: https://develop.svn.wordpress.org/trunk@52932 602fd350-edb4-49c9-b593-d223f7449a82
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:
- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes
Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes#39733.
git-svn-id: https://develop.svn.wordpress.org/trunk@52929 602fd350-edb4-49c9-b593-d223f7449a82
This change implements gradient background options that fit the color scheme used in Twenty Thirteen.
Props ianbelanger, tomjdevisser, audrasjb.
Fixes#49762.
git-svn-id: https://develop.svn.wordpress.org/trunk@52928 602fd350-edb4-49c9-b593-d223f7449a82
This change makes sure the `max-width` value is assigned for linked images.
Props JarretC, sabernhardt.
Fixes#48697.
git-svn-id: https://develop.svn.wordpress.org/trunk@52927 602fd350-edb4-49c9-b593-d223f7449a82
This change applies the default button styles to all button blocks in Twenty Sixteen, instead of only targeting those in `entry-content`. This means that any buttons added outside of `.entry-content`, such as in a widget area, will be styled the same as any other button blocks. This change also makes the theme custom colors work outside of `.entry-content`.
Follow-up to [44306].
Props mikachan, costdev, audrasjb.
Fixes#55167.
git-svn-id: https://develop.svn.wordpress.org/trunk@52926 602fd350-edb4-49c9-b593-d223f7449a82
This changeset applies `max-width` and `margin` CSS rules when `block-editor-writing-flow` and `editor-styles-wrapper` classes are on the same element.
Props charleyparkerdesign, sabernhardt, smit08, sclayf1.
Fixes#54169.
git-svn-id: https://develop.svn.wordpress.org/trunk@52925 602fd350-edb4-49c9-b593-d223f7449a82
Previously, `safecss_filter_attr` did not allow for `calc` and `var` in parsed CSS. Because of this, `wp_strip_all_tags` was used in `wp_get_layout_style` to allow for the use of these CSS functions to account for responsive widths. [50923] added support for both of these CSS functions in KSES, so `safecss_filter_attr` can now be used in `wp_get_layout_style` as originally intended.
Follow-up to [52069].
Props grapplerulrich.
Fixes#55356.
git-svn-id: https://develop.svn.wordpress.org/trunk@52924 602fd350-edb4-49c9-b593-d223f7449a82
Replace raw SQL queries to the terms table, with a call to the `get_terms` function. Using `get_terms` means that `term_exists` is now cached. For developers using `term_exists` where cache invalidation is disabled, such as importing, a workaround was added to ensure that queries are uncached.
Props Spacedmonkey, boonebgorges, flixos90, peterwilsoncc.
Fixes#36949.
git-svn-id: https://develop.svn.wordpress.org/trunk@52921 602fd350-edb4-49c9-b593-d223f7449a82
From the conceptual point it makes sense to execute global styles filters before post filters. So the post filters are always the last.
Props xknown, sergey, audrasjb, vortfu, oandregal, get_dave.
git-svn-id: https://develop.svn.wordpress.org/trunk@52895 602fd350-edb4-49c9-b593-d223f7449a82
When exporting personal data for a user request, if the export fails for any reason, a "Retry" link is displayed inline. However, up to this point, clicking this link performed no action. This change adds the `export-personal-data-handle` CSS class to the link to make sure it's picked up by the same delegated listener as the initial action. Clicking this link will now retry the export.
Props hellofromTonya, nomnom99, rafiahmedd, SergeyBiryukov, hasanuzzamanshamim.
Fixes#53032.
git-svn-id: https://develop.svn.wordpress.org/trunk@52846 602fd350-edb4-49c9-b593-d223f7449a82
Previously, a button was added to the modal view for a single media item in the "grid" view to copy the file URL to the user's clipboard. This change adds a similar function to the "list" view for each media item.
Follow-up to [48232].
Props pbiron, ravipatel, alexstine, afercia.
Fixes#54426.
git-svn-id: https://develop.svn.wordpress.org/trunk@52842 602fd350-edb4-49c9-b593-d223f7449a82
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but the terms were still being populated in the data for each table row via the `get_inline_data()` function, which only checked the `$taxonomy->show_ui` property.
This commit:
* Improves performance by ensuring that taxonomy terms are not unnecessarily populated for each table row when `show_in_quick_edit` is `false`.
* Properly populates the taxonomy terms when `show_in_quick_edit` is `true` and `show_ui` is `false`.
Follow-up to [31307].
Props jazbek, figureone, sabernhardt, ovidiul, webcommsat, SergeyBiryukov.
Fixes#42916, #49701.
git-svn-id: https://develop.svn.wordpress.org/trunk@52841 602fd350-edb4-49c9-b593-d223f7449a82
Adds an end-to-end (e2e) test case for:
* Emptying a post from the trash.
* Restoring a post from the trash.
Props pavanpatil1, pooja1210, justinahinon, kevin940726.
Fixes#54843.
git-svn-id: https://develop.svn.wordpress.org/trunk@52839 602fd350-edb4-49c9-b593-d223f7449a82
Removes the "starting" word from "starting containing" as this is a typo. Includes minor formatting adjustments to improve readability.
Follow-up to [38726].
Props mehedi890, SergeyBiryukov, mukesh27.
Fixes#55355.
git-svn-id: https://develop.svn.wordpress.org/trunk@52838 602fd350-edb4-49c9-b593-d223f7449a82
Store the file size of all newly uploaded attachments, as part of the metadata stored in post meta. Storing file size means, developers will not have to resort to doing `filesize` function calls, that can be time consuming on assets on offloaded to services like Amazon’s S3.
This change also introduces a new helper function called, `wp_filesize`. This is a wrapper around the `filesize` php function, that adds some helpful filters and ensures the return value is an integer.
Props Cybr, Spacedmonkey, SergeyBiryukov, johnwatkins0, swissspidy, desrosj, joemcgill, azaozz, antpb, adamsilverstein, uday17035.
Fixes#49412.
git-svn-id: https://develop.svn.wordpress.org/trunk@52837 602fd350-edb4-49c9-b593-d223f7449a82
The query cache currently implemented in `WP_Term_Query` caches the final output of the query, depending on what fields are requested. This is wasteful, as if a user requests `fields` => `all`, then an unlimited array of `WP_Term` objects could be stored in the object cache. Instead of storing the whole WP_Term object, this change only the term_id is stored. To get an array the full WP_Term objects, the `_prime_term_caches` function is called with an array of ids. In instances where a persistent object cache is not in use, then this will result in another SQL query to be run. After `_prime_term_caches` is called if this term is requested again in the same page load, then it will already be loaded into memory. If a user runs `WP_Term_Query` with the fields param set to `all_with_object_id`, an array of objects containing both the term_id and object_ids are stored in cache.
This change also improves the logic to load term meta caches. This change ensures that term meta is always primed for all terms loaded in the term query.
Props Spacedmonkey, boonebgorges, jbpaul17, peterwilsoncc, flixos90, pbearne.
Fixes#37189.
git-svn-id: https://develop.svn.wordpress.org/trunk@52836 602fd350-edb4-49c9-b593-d223f7449a82
Reverse the logic of the `prefers-reduced-motion` to enable transitions based on `no-preference` rather than disable them based on the `reduce` preference. This removes the need to disable transitions with the `! important` tag and unintended interactions with plugins as a result.
Props gregoiresailland, sabernhardt, ryokuhi.
Fixes#54174.
git-svn-id: https://develop.svn.wordpress.org/trunk@52835 602fd350-edb4-49c9-b593-d223f7449a82
Add a forth parameter to the `wp_sitemaps_taxonomies_entry` filter to pass the entire `WP_Term` object.
Correct the documentation for the second parameter of the `wp_sitemaps_taxonomies_entry` filter to indicate it is a term ID rather than term object.
Props RavanH, swissspidy, audrasjb.
Fixes#55239.
git-svn-id: https://develop.svn.wordpress.org/trunk@52834 602fd350-edb4-49c9-b593-d223f7449a82
This avoids an "Undefined index" PHP notice when a schemeless URI is passed.
Props dd32, SergeyBiryukov.
Fixes#55333.
git-svn-id: https://develop.svn.wordpress.org/trunk@52833 602fd350-edb4-49c9-b593-d223f7449a82
Revert [52829] due to fatal errors in some Multisite configurations.
Props dd32, SergeyBiryukov, audrasjb.
See #30377.
git-svn-id: https://develop.svn.wordpress.org/trunk@52832 602fd350-edb4-49c9-b593-d223f7449a82
Remove the second parameter on the call to `update_term_cache()` from within the function `_prime_term_caches()`. The since deprecated parameter of the former was at one point a string, never a boolean.
Props david.binda, SergeyBiryukov, azouamauriac.
Fixes#55162.
git-svn-id: https://develop.svn.wordpress.org/trunk@52830 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adjusts the regex in `wp_check_filetype()` to support query strings in URLs.
Follow-up to [30640], [32172].
Props voldemortensen, johnbillion, layotte, dd32, atomicjack, supercleanse, spencercameron, ianmjones, audrasjb.
Fixes#30377.
git-svn-id: https://develop.svn.wordpress.org/trunk@52829 602fd350-edb4-49c9-b593-d223f7449a82