This changeset sets default width to `100px` for the Separator block, and sets the Separator block located in the Call to Action block pattern to `wide`.
Props haritpanchal, audrasjb, sakibmd, poena, Rahmohn, mikachan.
Fixes#57667.
Built from https://develop.svn.wordpress.org/trunk@56173
git-svn-id: http://core.svn.wordpress.org/trunk@55685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sets `font-weight: 700` for these elements in the editor, in order to match the front end styles. It overrides the default admin `font-weight` of `600` for
these HTML elements.
Props nkeller15, audrasjb, sabernhardt, pavanpatil1, iamfarhan09, poena.
Fixes#58383.
Built from https://develop.svn.wordpress.org/trunk@56172
git-svn-id: http://core.svn.wordpress.org/trunk@55684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a new Help text for Rollback feature in the WordPress Updates screen. Also adds a link to the "Common Errors" HelpHub documentation page.
Follow-up to [51857].
Props costdev, afragen, audrasjb, kebbet, marybaum.
Fixes#58199.
Built from https://develop.svn.wordpress.org/trunk@56171
git-svn-id: http://core.svn.wordpress.org/trunk@55683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This replaces `add_theme_support( 'experimental-link-color' )` with `add_theme_support( 'link-color' )`, to provide the feature to Twenty Twenty-One users, but
also to avoid throwing a "doing it wrong" message when Gutenberg version 16.2 is active.
Follow-up to [58597].
Props poena.
Fixes#58702.
Built from https://develop.svn.wordpress.org/trunk@56170
git-svn-id: http://core.svn.wordpress.org/trunk@55682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow-up to [56037], as that changeset accidentally did not consider the changes made in [55825]: Images that are programmatically injected into post content (e.g. through a block, or shortcode, or any hook calling a function like `wp_get_attachment_image()`) must be treated as part of the whole post content blob since otherwise the heuristics for applying `fetchpriority="high"` and `loading="lazy"` are skewed by parsing certain images before others rather than sequentially parsing the entire post content. [55825] addressed that for lazy-loading, but when [56037] introduced `fetchpriority` support, the related refactor missed making the same consideration for that attribute.
Props flixos90, spacedmonkey, thekt12, mukesh27.
Fixes#58235.
See #58089.
Built from https://develop.svn.wordpress.org/trunk@56164
git-svn-id: http://core.svn.wordpress.org/trunk@55676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Correctly return the existing autosave when an unchanged autosave is saved, instead of returning an error.
Fix regressions after r55154 where an error and not the original autosave was returned when saving with unchanged data (for example, clicking the preview button repeatedly). Returning the autosave (ID) is the expected behavior for the endpoint.
Follow up to [55154]
Props Mamaduka, jeroenrotty, mrfoxtalbot.
Fixes#58739.
Built from https://develop.svn.wordpress.org/trunk@56163
git-svn-id: http://core.svn.wordpress.org/trunk@55675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp-before-template` and `wp-template` metric intend to separate WordPress core's own bootstrap process from any logic that is part of the eventual template loaded. The appropriate hook for that is the `template_include` filter as that occurs right before the template file is included.
Props mukesh27, joemcgill.
Fixes#58674.
Built from https://develop.svn.wordpress.org/trunk@56162
git-svn-id: http://core.svn.wordpress.org/trunk@55674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix deprecation warning for dynamic property in object cache drop-in used in core unit tests.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
Props spacedmonkey, johnbillion.
Fixes#58736.
See #56034.
Built from https://develop.svn.wordpress.org/trunk@56161
git-svn-id: http://core.svn.wordpress.org/trunk@55673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a bug where the `margin-left: auto` property was being overwritten to `margin-left: 0` causing an inconsistency in the alignment of these blocks.
Follow-up to [56034], [56039], [56040].
Props sabernhardt.
Fixes#58396.
Built from https://develop.svn.wordpress.org/trunk@56155
git-svn-id: http://core.svn.wordpress.org/trunk@55667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds support for loading optimization attributes such as `loading="lazy"` and `fetchpriority="high"` to the image widget. A new context `widget_media_image` is introduced for that purpose.
Props spacedmonkey, thekt12, mukesh27, westonruter.
Fixes#58704.
See #58235.
Built from https://develop.svn.wordpress.org/trunk@56154
git-svn-id: http://core.svn.wordpress.org/trunk@55666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a check for the existence of `db.php` at the default path `ABSPATH . 'wp-content/db.php'`, even if `WP_CONTENT_DIR` is defined and `db.php`
is placed in `WP_CONTENT_DIR`.
Follow-up to [49161].
Props mikeyzm, SergeyBiryukov, hztyfoon,
Fixes#58201.
Built from https://develop.svn.wordpress.org/trunk@56152
git-svn-id: http://core.svn.wordpress.org/trunk@55664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This also introduces `wp_is_password_reset_allowed_for_user()` which returns `false` when password reset is not allowed for a specific user. This can be
filtered by developers using the existing `allow_password_reset` hook.
Props ocean90, cshark, robinwpdeveloper, tahmina1du, kraftbj.
Fixes#58194.
Built from https://develop.svn.wordpress.org/trunk@56150
git-svn-id: http://core.svn.wordpress.org/trunk@55662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This reintroduces HTML5 Shiv script that was removed in [55980], to ensure backward compatibility for websites that opted-in to IE support. Also reintroduces
HTML5 credits.
Follow-up to [55980].
Props sabernhardt.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@56149
git-svn-id: http://core.svn.wordpress.org/trunk@55661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Following [55318], [55847], and [56142], certain images in the header of the page have received support for potentially receiving `fetchpriority="high"` and having the `loading="lazy"` attribute omitted. However, these images being present did not affect the "content media count" which counts the images towards a certain threshold so that the first ones are not lazy-loaded.
This changeset also increases that count for such header images if they are larger than a certain threshold. The threshold is used to avoid e.g. a header with lots of small images such as icon graphics to skew the lazy-loading behavior.
Props thekt12, spacedmonkey, flixos90.
Fixes#58635.
Built from https://develop.svn.wordpress.org/trunk@56143
git-svn-id: http://core.svn.wordpress.org/trunk@55655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset is a follow up to [56037] and ensures that the `get_header_image_tag()` function receives the benefits of `wp_get_loading_optimization_attributes()` as well. Prior to `fetchpriority` support, this was not needed since the header image should never be lazy-loaded, but the image certainly is a `fetchpriority` candidate, so therefore it is crucial to have it supported.
Props felipeelia, spacedmonkey, mukesh27, westonruter, flixos90.
Fixes#58680.
Built from https://develop.svn.wordpress.org/trunk@56142
git-svn-id: http://core.svn.wordpress.org/trunk@55654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account.
Thank you for your service, PHP 5. Onwards!
Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune
Fixes#57345
Built from https://develop.svn.wordpress.org/trunk@56141
git-svn-id: http://core.svn.wordpress.org/trunk@55653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Casting the values to a string causes `Array to string conversion` PHP warnings, so using loose comparison restores the previous behavior for code relying on type juggling when using the `wp_list_filter()` function, e.g. comparing a numeric string to an integer.
The unit test case added for this scenario in the previous commit remains.
Follow-up to [55908], [56137].
See #57839.
Built from https://develop.svn.wordpress.org/trunk@56138
git-svn-id: http://core.svn.wordpress.org/trunk@55650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to preserve backward compatibility for code relying on type juggling when using the `wp_list_filter()` function, e.g. comparing a numeric string to an integer.
Follow-up to [55908].
Props azaozz, jeremyfelt, david.binda.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@56137
git-svn-id: http://core.svn.wordpress.org/trunk@55649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, this function did not normalize paths before using `glob()` or registering styles. This led to a mixture of forward-slashes and back-slashes in
Windows environments.
This change uses `wp_normalize_path()` to ensure Windows compatibility.
Props wildworks, costdev, kafleg, mukesh27.
Fixes#58711.
Built from https://develop.svn.wordpress.org/trunk@56136
git-svn-id: http://core.svn.wordpress.org/trunk@55648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When saving the settings via the admin UI, the default value for any options not passed in the current `$_POST` request is set to `null` in `wp-admin/options.php`. Some options, e.g. `blog_public`, then rely on `null` being passed to `update_option()` to determine whether the value was changed or not.
This commit resolves a PHP 8.1 deprecation notice when saving the `gmt_offset` option without any changes:
{{{
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}
Includes a similar fix for the `blog_charset` option.
Follow-up to [4112], [4329], [5541], [21849].
Props adi3890, dhrupo, hrdelwar, hasanmisbah, oglekler, mukesh27, SergeyBiryukov.
Fixes#57728.
Built from https://develop.svn.wordpress.org/trunk@56132
git-svn-id: http://core.svn.wordpress.org/trunk@55644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset moves font styling from link element to site title (or post title) block in Marigold and Whisper style variations, which allows to change Site
Title block font size.
Props ryelle, shuvoaftab, sabernhardt, alvitazwar052, shailu25, poena, audrasjb.
Fixes#57971.
Built from https://develop.svn.wordpress.org/trunk@56131
git-svn-id: http://core.svn.wordpress.org/trunk@55643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves `Undefined array key` PHP warnings when trying to access any of these values in `WP_Http_Curl::request()` or `WP_Http_Streams::request()`:
* `$parsed_args['decompress']`
* `$parsed_args['stream']`
* `$parsed_args['filename']`
Follow-up to [10410], [11236], [13274], [17555], [37428], [42766], [44346].
Props sjoerdlinders, hellofromTonya, jrf, oglekler, Clorith, SergeyBiryukov.
Fixes#52622.
Built from https://develop.svn.wordpress.org/trunk@56128
git-svn-id: http://core.svn.wordpress.org/trunk@55640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids an `Undefined variable $checkout` PHP warning if all of the directories checked for access are disallowed due to the PHP `open_basedir` restrictions.
Follow-up to [55425].
Props jqz, costdev, audrasjb.
Fixes#58563.
Built from https://develop.svn.wordpress.org/trunk@56124
git-svn-id: http://core.svn.wordpress.org/trunk@55636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures scheduled posts are actually published when changing their status to "Published" using bulk edit. Also adds related unit tests.
Props siobhan, Clorith, webcommsat, cadic, oglekler, audrasjb, pavanpatil1.
Fixes#31635.
Built from https://develop.svn.wordpress.org/trunk@56123
git-svn-id: http://core.svn.wordpress.org/trunk@55635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The description of returned values in array was incorrect for `image_get_intermediate_size()`:
- `$file` returns the filename of image, no path information
- `$path` returns path relative to the uploads directory, not absolute
Props crstauf, sccr410.
Fixes#58686.
See #57840.
Built from https://develop.svn.wordpress.org/trunk@56122
git-svn-id: http://core.svn.wordpress.org/trunk@55634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes HTML tags from the label, which were not displayed as expected due to escaping. Including the directory name in the label is also redundant, as it is already mentioned in the check result description directly below.
Includes:
* Adjusting a few other labels for consistency.
* Moving `wp-content` out of the translatable string in a similar message in `WP_Upgrader::generic_strings()`.
Follow-up to [55720].
Props dlh, mukesh27, audrasjb, SergeyBiryukov.
See #58678.
Built from https://develop.svn.wordpress.org/trunk@56117
git-svn-id: http://core.svn.wordpress.org/trunk@55629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
It's expected that this query variable contains a string when it's set, but it's possible for its type to be something else such as an array. Ignoring non-string values prevents cascading errors when its value is passed through functions that expect a string.
Props xknown, costdev, jrf, azaozz
Fixes#57670
Built from https://develop.svn.wordpress.org/trunk@56115
git-svn-id: http://core.svn.wordpress.org/trunk@55627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a matrix to the e2e test runs on GitHub Actions so the tests run both with and without `SCRIPT_DEBUG` enabled. This allows us to catch scenarios where the minified and non-minified files may differ.
Props Clorith, joemcgill
Fixes#58661
Built from https://develop.svn.wordpress.org/trunk@56113
git-svn-id: http://core.svn.wordpress.org/trunk@55625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves an `Undefined array key "password"` PHP warning in `WP_Filesystem_SSH2::connect()` when using public/private key authentication, in which case providing a password is optional.
Follow-up to [8865].
Props J-Dill, costdev, ehsanakhgari, dd32.
Fixes#33196.
Built from https://develop.svn.wordpress.org/trunk@56111
git-svn-id: http://core.svn.wordpress.org/trunk@55623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds handler for multiple cases where author data can be passed to the Query Block:
- array: array of author ids
- string: comma separated author ids
- integer: single author id
Props adi3890, costdev, mayur8991, oglekler.
Fixes#58426.
Built from https://develop.svn.wordpress.org/trunk@56109
git-svn-id: http://core.svn.wordpress.org/trunk@55621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, when the `do-plugin-upgrade` or `do-theme-upgrade` actions were accessed directly on `update-core.php`, an error message stating "Select one or
more (plugins|themes) to update" would be shown even if there was nothing to update.
This ensures that the error message only appears when there is something to update.
Props Presskopp, sabernhardt, pbiron, afragen, zunaid321, shuvoaftab, ugyensupport, costdev.
Fixes#57999.
Built from https://develop.svn.wordpress.org/trunk@56107
git-svn-id: http://core.svn.wordpress.org/trunk@55619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures the Button block text color is consistent when this block is used in a footer widget.
Props mayur8991, itpathsolutions, nithins53, sabernhardt, arafatjamil01, thakordarshil, pooja1210, mukesh27, shailu25, shwetabathani2312.
Fixes#57087.
Built from https://develop.svn.wordpress.org/trunk@56106
git-svn-id: http://core.svn.wordpress.org/trunk@55618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces the `780px` media query `max-width` value with `782px` for better consistency and to fix a responsive layout issue.
Props zodiac1978, ironprogrammer, orestissam, audrasjb, monzuralam.
Fixes#58164.
Built from https://develop.svn.wordpress.org/trunk@56104
git-svn-id: http://core.svn.wordpress.org/trunk@55616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update `@wordpress/*` packages to the latest patch versions in
order to replace calls to `gutenberg_apply_colors_support` with
`wp_apply_colors_support` in order to avoid a fatal error.
Props joemcgill, spacedmonkey, flixos90, ironprogrammer, sabernhardt.
Fixes#58651.
Built from https://develop.svn.wordpress.org/trunk@56098
git-svn-id: http://core.svn.wordpress.org/trunk@55610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improve logic in `wp_theme_has_theme_json()`, to only check to see if theme.json exists in child theme, if the current theme is a child theme. Without this change, `file_exists` would be called twice on every request, which is wasteful.
Follow up to [56085].
Props spacedmonkey, SergeyBiryukov.
Fixes#57629.
Built from https://develop.svn.wordpress.org/trunk@56094
git-svn-id: http://core.svn.wordpress.org/trunk@55606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset introduces the `bulk_edit_posts` action hook, triggered after processing the post data for bulk edit and before the function returns its results. For example, it allows developers to save additional data without having to perform any `.ajax()` calls.
Follow-up to [8973].
Props helgatheviking, helen, Mte90, afercia, mrasharirfan, desrosj, itowhid06, pento, mensmaximus, audrasjb, costdev, webcommsat, marybaum, oglekler, mukesh27, SergeyBiryukov.
Fixes#28112.
Built from https://develop.svn.wordpress.org/trunk@56091
git-svn-id: http://core.svn.wordpress.org/trunk@55603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the block editor is rendered, the editor content is wrapped inside an iframe tag; The tool used to run End to End (E2E) tests, Puppeteer, puts all such frames into separate containers, but the initial test was checking if the parent page had a given selector, which was leading to timeout failures. By actively switching the container to the iframe wrapper,and setting it as the active context, it helps ensure the expected selectors can be found, and its content can be verrified.
See #58592.
Props joemcgill, SergeyBiryukov, talldanwp, oglekler, Clorith.
Built from https://develop.svn.wordpress.org/trunk@56089
git-svn-id: http://core.svn.wordpress.org/trunk@55601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Duplicates the code of `get_theme_file_path()` within `wp_theme_has_theme_json()`. This is to account for the `load-styles.php` context in which the former function is unavailable.
Follow up to [56073].
Props SergeyBiryukov, oglekler, spacedmonkey, joemcgill, dd32.
Fixes#57629.
Built from https://develop.svn.wordpress.org/trunk@56085
git-svn-id: http://core.svn.wordpress.org/trunk@55597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a fatal error in the Navigation block, which was due to a reference
to `WP_Navigation_Fallback_Gutenberg` that isn’t present in Core under that name.
Follow-up to [56065].
Props ramonjd, isabel_brison, dmsnell.
Fixes#58623.
Built from https://develop.svn.wordpress.org/trunk@56076
git-svn-id: http://core.svn.wordpress.org/trunk@55588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Resolves a bug where a post save will be reported as failed if the post includes any meta keys the current user does not have authorization to update, even when those meta values are unchanged.
Write authorization is now checked for a meta key only when the value of that key has changed, so that passing a REST response back unchanged will not cause failures.
Authorization is only needed when data will be updated.
Props ckoerner, TimothyBlynJacobs, spacedmonkey
Built from https://develop.svn.wordpress.org/trunk@56075
git-svn-id: http://core.svn.wordpress.org/trunk@55587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Use `sessionStorage` to remember the previous results of calls to `browserSupportsEmoji()` for 1 week.
* Optimize reading from canvas by supplying the `willReadFrequently` option for the 2D context.
* When `OffscreenCanvas` is available, offload `browserSupportsEmoji()` to a web worker to prevent blocking the main thread. This is of primary benefit to Safari which does not yet support `willReadFrequently`.
* Remove obsolete support for IE11 since promises are now utilized. Nevertheless, ES3 syntax is maintained and IE11 will simply short-circuit.
Props westonruter, dmsnell, peterwilsoncc, valterlorran, flixos90, spacedmonkey, joemcgill.
Fixes#58472.
Built from https://develop.svn.wordpress.org/trunk@56074
git-svn-id: http://core.svn.wordpress.org/trunk@55586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that all places where `theme.json` is included, use `get_theme_file_path` or `WP_Theme->get_file_path`, so that the path is run through `theme_file_path` filter. This change also means that the method `get_file_path_from_theme` can be deprecated, as it is no longer used in core.
Props flixos90, spacedmonkey, costdev, johnbillion, oglekler, hellofromtonya, mukesh27, audrasjb, oandregal.
Fixes#57629.
Built from https://develop.svn.wordpress.org/trunk@56073
git-svn-id: http://core.svn.wordpress.org/trunk@55585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes unit tests to verify the logic for displaying row actions in the Media Library in certain scenarios, e.g. with and without the “Trash” or “Unattached” filter.
Follow-up to [55949].
Props costdev, kebbet, mukesh27, oglekler.
Fixes#57893.
Built from https://develop.svn.wordpress.org/trunk@56072
git-svn-id: http://core.svn.wordpress.org/trunk@55584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a new optional `$include_hidden` parameter to allow the inclusion of hidden (`.` prefixed) files.
Defaults to false for backward compatibility.
Props yani.iliev, sabernhardt, costdev, rutviksavsani, zunaid321, azaozz.
Fixes#53659.
Built from https://develop.svn.wordpress.org/trunk@56069
git-svn-id: http://core.svn.wordpress.org/trunk@55581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds the `plugins_list` hook, which can be use to filter the list of plugin displayed on WP Admin Plugins screen.
Props nateallen, fischfood, mukesh27, peterwilsoncc, SergeyBiryukov, audrasjb, costdev, ecorica, zunaid321.
Fixes#57278.
Built from https://develop.svn.wordpress.org/trunk@56068
git-svn-id: http://core.svn.wordpress.org/trunk@55580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This introduces a new set of hooks that can be used to filter various HTML elements of the Nav Walker, in order to output the desired HTML attributes:
- List items: `nav_menu_item_attributes`
- Submenu `<ul>` element: `nav_menu_submenu_attributes`
Props davidwebca, danyk4, costdev, peterwilsoncc, audrasjb, oglekler.
Fixes#57140.
Built from https://develop.svn.wordpress.org/trunk@56067
git-svn-id: http://core.svn.wordpress.org/trunk@55579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the foreach loop of last results, move the if statement outside of the loop. There is no need to check every element in the array for the output type. Do this once outside of the loop. For large database queries with lots of rows returned, this should improve PHP performance.
Props spacedmonkey, Cybr, johnbillion, costdev, joemcgill.
Fixes#56541.
Built from https://develop.svn.wordpress.org/trunk@56066
git-svn-id: http://core.svn.wordpress.org/trunk@55578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.
Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes#58623.
Built from https://develop.svn.wordpress.org/trunk@56065
git-svn-id: http://core.svn.wordpress.org/trunk@55577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [52069] the function `wp_common_block_scripts_and_styles` was changed load individual theme stylesheets, if the current theme supports block styles and loading separate core block assets. To do this, the function calls many expensive file operation functions, such as `glob`, `file_exists` and `file_get_contents`. This is wasteful, as these functions are loaded on every page request, even request that do not include blocks, like REST API calls. In [56044] all core block styles are registered in a single place. In `register_core_block_style_handles` calls `glob` to get all css styles in block directories. While registering style and editor styles, also register block theme styles, under a new style handle. Example `wp-block-avatar-theme`. If the current theme supports block styles, also request the block to enqueue the theme style on the front end. As these new stylesheets have a path attribute set, the function `wp_maybe_inline_styles` will automatically inline the styles for you.
Props spacedmonkey, flixos90, oandregal, costdev, audrasjb, mukesh27.
Fixes#58560.
Built from https://develop.svn.wordpress.org/trunk@56064
git-svn-id: http://core.svn.wordpress.org/trunk@55576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the `<body>` element, as a best practice background color and text color should always be set together. This makes it easier to quickly understand the
underlying color scheme.
Follow-up to [55960], [55964].
Props sabernhardt, audrasjb, kebbet.
Fixes#45916.
Built from https://develop.svn.wordpress.org/trunk@56062
git-svn-id: http://core.svn.wordpress.org/trunk@55574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Tweak the `wp_load_core_site_options` function, to also prime network options using `wp_cache_get_multiple` if persistent object cache is present.
Props mukesh27, oglekler, peterwilsoncc, costdev, jeremyfelt, spacedmonkey.
Fixes#56913.
Built from https://develop.svn.wordpress.org/trunk@56061
git-svn-id: http://core.svn.wordpress.org/trunk@55573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the function `_template_loader_filters` was ported to core from gutenberg, it retained the filter to load block templates. However, the function `locate_block_template` is called manually in `get_query_template`, so this filter is not needed. Calling `locate_block_template` twice, results in performance issue, as `locate_block_template` is a expensive function to run, as it does database and file lookups.
Props dlh, mukesh27, flixos90, SergeyBiryukov, bernhard-reiter, spacedmonkey.
Fixes#58299.
Built from https://develop.svn.wordpress.org/trunk@56060
git-svn-id: http://core.svn.wordpress.org/trunk@55572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Restructures the block.json selectors API by moving `__experimentalSelector` props into their own config, stabilizing the selectors API, and enabling more flexible styling options.
Props ramonopoly, spacedmonkey, aaronrobertshaw, onemaggie.
Fixes#58586.
Built from https://develop.svn.wordpress.org/trunk@56058
git-svn-id: http://core.svn.wordpress.org/trunk@55570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds the `#content` fragment identifier to paginated links so the screen scrolls down to the content section when clicking on pagination links
located on paginated pages.
Props laurelfulford, mukesh27, joyously, poena, alvitazwar052, oglekler, audrasjb.
Fixes#45920.
Built from https://develop.svn.wordpress.org/trunk@56057
git-svn-id: http://core.svn.wordpress.org/trunk@55569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds "Current time, "Current UTC time" and "Current Server time" under the "Server" section of Site Health debug infos. This provides the
current time, the server time, and allow for comparison if there's some time-related issues.
Props sebastienserre, Clorith, audrasjb, kebbet, robinwpdeveloper, hrrarya, mukesh27, hareesh-pillai, costdev.
Fixes#56378.
Built from https://develop.svn.wordpress.org/trunk@56056
git-svn-id: http://core.svn.wordpress.org/trunk@55568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update the `@wordpress/block-serialization-default-parser` to 4.35.1 for WordPress 6.3 Beta 1. These changes split the following classes in to their own files in order to match the WordPress PHP coding standards:
* `WP_Block_Parser_Block`
* `WP_Block_Parser_Frame`
* `WP_Block_Parser`
These classes were previously all included in the `src/wp-includes/class-wp-block-parser.php` file. In order to maintain backward compatibly for developers requiring the file directly, the relocated classes are replaced with `require_once` calls in the original file.
In order to retain the commit history of the new files, they have been created using the `svn copy` command.
Props aristath, rajanpanchal2028, jrf, SergeyBiryukov, costdev, manfcarlo, spacedmonkey, mukesh27, isabel_brison, dd32.
Fixes#57832.
See #58623.
Built from https://develop.svn.wordpress.org/trunk@56048
git-svn-id: http://core.svn.wordpress.org/trunk@55560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the `$n` variable from `TwentyTwenty_Walker_Page` class `start_el()` function, removes an unused global and the last parameter from
`twentytwenty_filter_wp_list_pages_item_classes()` and `twentytwenty_add_sub_toggles_to_main_menu()`.
Props upadalavipul, sabernhardt, mukesh27.
Fixes#57371.
Built from https://develop.svn.wordpress.org/trunk@56045
git-svn-id: http://core.svn.wordpress.org/trunk@55557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Register all core blocks in a new function called `register_core_block_style_handles`. This mirrors the function `wp_default_styles` where all core styles are registered in one place. This improves block registration performance, as it avoids expensive file lookups, like realpath in `register_block_style_handle`. The new function `register_core_block_style_handles` uses `glob` to get all css files in the blocks directory. This glob is cached in a transient to save lookups on subsequent requests. The function `register_block_style_handle` now checks to see if the style handle is already registered before trying to register it again.
Props mukesh27, westonruter, flixos90, joemcgill, spacedmonkey.
Fixes#58528.
Built from https://develop.svn.wordpress.org/trunk@56044
git-svn-id: http://core.svn.wordpress.org/trunk@55556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a `$previous_status` parameter to the `pre_trash_post`, `wp_trash_post`, and `trashed_post` hooks.
Props mujuonly, mukesh27, nihar007, dhruvishah2203, SergeyBiryukov, costdev, hugod, audrasjb, oglekler.
Fixes#58392.
Built from https://develop.svn.wordpress.org/trunk@56043
git-svn-id: http://core.svn.wordpress.org/trunk@55555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In recent releases, WordPress core added several instances of cache usage around specific files. While those caches are safe to use in a production context, in development certain nuances apply for whether or not those caches make sense to use. Initially, `WP_DEBUG` was used as a temporary workaround, but it was clear that a more granular method to signify a specific development mode was required: For example, caches around `theme.json` should be disabled when working on a theme as otherwise it would disrupt the theme developer's workflow, but when working on a plugin or WordPress core, this consideration does not apply.
This changeset introduces a `WP_DEVELOPMENT_MODE` constant which, for now, can be set to either "core", "plugin", "theme", or an empty string, the latter of which means no development mode, which is also the default. A new function `wp_get_development_mode()` is the recommended way to retrieve that configuration value.
With the new function available, this changeset replaces all existing instances of the aforementioned `WP_DEBUG` workaround to use `wp_get_development_mode()` with a more specific check.
Props azaozz, sergeybiryukov, peterwilsoncc, spacedmonkey.
Fixes#57487.
Built from https://develop.svn.wordpress.org/trunk@56042
git-svn-id: http://core.svn.wordpress.org/trunk@55554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds `description` to `VALID_TOP_LEVEL_KEYS` in `class-wp-theme-json.php` to allow for accessibility improvements. The description is added to
the ARIA label of the style variation container. If the style variation has no description, only the title is used. One purpose is to use the text description
to improve the style variation preview in the WordPress.org theme directory.
See https://github.com/WordPress/gutenberg/pull/45242.
Props ramonopoly, poena.
Fixes#58614.
--Cette ligne, et les suivantes ci-dessous, seront ignorées--
M trunk/src/wp-includes/class-wp-theme-json.php
Built from https://develop.svn.wordpress.org/trunk@56041
git-svn-id: http://core.svn.wordpress.org/trunk@55553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds support for the `fetchpriority` attribute, which is typically added to a single image in each HTML response with a value of "high". This enhances load time performance (also Largest Contentful Paint, or LCP) by telling the browser to prioritize this image for downloading even before the layout of the page has been computed. In lab tests, this has shown to improve LCP performance by ~10% on average.
Specifically, `fetchpriority="high"` is added to the first image that satisfies all of the following conditions:
* The image is not lazy-loaded, i.e. does not have `loading="lazy"`.
* The image does not already have a (conflicting) `fetchpriority` attribute.
* The size of of the image (i.e. width * height) is greater than 50,000 squarepixels.
While these heuristics are based on several field analyses, there will always be room for optimization. Sites can customize the squarepixel threshold using a new filter `wp_min_priority_img_pixels` which should return an integer for the value.
Since the logic for adding `fetchpriority="high"` is heavily intertwined with the logic for adding `loading="lazy"`, yet the features should work decoupled from each other, the majority of code changes in this changeset is refactoring of the existing lazy-loading logic to be reusable. For this purpose, a new function `wp_get_loading_optimization_attributes()` has been introduced which returns an associative array of performance-relevant attributes for a given HTML element. This function replaces `wp_get_loading_attr_default()`, which has been deprecated. As another result of that change, a new function `wp_img_tag_add_loading_optimization_attrs()` replaces the more specific `wp_img_tag_add_loading_attr()`, which has been deprecated as well.
See https://make.wordpress.org/core/2023/05/02/proposal-for-enhancing-lcp-image-performance-with-fetchpriority/ for the original proposal and additional context.
Props thekt12, joemcgill, spacedmonkey, mukesh27, costdev, 10upsimon.
Fixes#58235.
Built from https://develop.svn.wordpress.org/trunk@56037
git-svn-id: http://core.svn.wordpress.org/trunk@55549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a bug in the Editor, where the Separator block did not support background color selections other than white and light gray.
Props nidhidhandhukiya, sabernhardt, shailu25, harshgajipara, mukesh27, costdev, zunaid321.
Fixes#58558.
Built from https://develop.svn.wordpress.org/trunk@56036
git-svn-id: http://core.svn.wordpress.org/trunk@55548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Computation of unresolvable version conflicts in the Gutenberg package
sync script had a few issues that were causing it to fail, among them
two type errors in the destructuring of function arguments.
Furthermore, de-duplication of required package versions was missing,
leading to false positives being reported, when multiple instances of
the same package all required the same version.
Props dmsnell.
Fixes#58628.
Built from https://develop.svn.wordpress.org/trunk@56035
git-svn-id: http://core.svn.wordpress.org/trunk@55547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a bug where the `margin-left: auto` property was being overwritten to `margin-left: 0` causing an inconsistency in the alignment of these blocks.
Props nkeller15, nadimcse, sabernhardt, tb1909, poena.
Fixes#58396.
Built from https://develop.svn.wordpress.org/trunk@56034
git-svn-id: http://core.svn.wordpress.org/trunk@55546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows developers to register scripts with an intended loading strategy by changing the `$in_footer` parameter of `wp_register_script` and `wp_enqueue_script` to an array that accepts both an `in_footer` and `strategy` argument. If present, the loading strategy attribute will be added to the script tag when that script is printed to the page as long as it is not a dependency of any blocking scripts, including any inline scripts attached to the script or any of its dependents.
Props 10upsimon, thekt12, westonruter, costdev, flixos90, spacedmonkey, adamsilverstein, azaozz, mukeshpanchal27, mor10, scep, wpnook, vanaf1979, Otto42.
Fixes#12009.
Built from https://develop.svn.wordpress.org/trunk@56033
git-svn-id: http://core.svn.wordpress.org/trunk@55545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988], [56021], [56031].
See #58206.
Built from https://develop.svn.wordpress.org/trunk@56032
git-svn-id: http://core.svn.wordpress.org/trunk@55544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988], [56021].
See #58206.
Built from https://develop.svn.wordpress.org/trunk@56031
git-svn-id: http://core.svn.wordpress.org/trunk@55543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a up/down arrow for visual affordance about the purpose of the button link; change button text from "Show details" to "More details".
Props krupajnanda, subrataemfluence, audrasjb, afercia, nrqsnchz, joedolson.
Fixes#44714.
Built from https://develop.svn.wordpress.org/trunk@56027
git-svn-id: http://core.svn.wordpress.org/trunk@55539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a fallback condition with heading and error notice to handle a no JavaScript state for the site editor, comparable to what already exists in the post editor.
Props afercia, joedolson, fencermonir, zebaafiashama, alexstine, rudlinkon.
Fixes#56228.
Built from https://develop.svn.wordpress.org/trunk@56025
git-svn-id: http://core.svn.wordpress.org/trunk@55537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Accessibly associate field description text with relevant input fields. Add `aria-describedby` and target IDs for each description field. Update privacy text note to better reflect relevancy to specific fields.
Props costdev, joedolson.
Fixes#58613.
Built from https://develop.svn.wordpress.org/trunk@56024
git-svn-id: http://core.svn.wordpress.org/trunk@55536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Move the visual positioning of the posts search form into it's DOM position. Fixes an accessibility bug where the keyboard focus sequence did not match the visual order. Change the media search form in list view to match the format of other post views. Give search forms a consistent layout on mobile.
Props oglekler, sabernhardt, joedolson.
Fixes#57949.
Built from https://develop.svn.wordpress.org/trunk@56023
git-svn-id: http://core.svn.wordpress.org/trunk@55535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that quick edit does not define a publish date if the post status is one of 'draft', 'pending', or 'auto-draft'.
Props uxtremist, SergeyBiryukov, Denis-de-Bernardy, jane, rfischmann, mista-flo, rutviksavsani, oglekler, joedolson.
Fixes#19907.
Built from https://develop.svn.wordpress.org/trunk@56022
git-svn-id: http://core.svn.wordpress.org/trunk@55534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988].
Props spacedmonkey.
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56021
git-svn-id: http://core.svn.wordpress.org/trunk@55533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990], [56014], [56019].
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56020
git-svn-id: http://core.svn.wordpress.org/trunk@55532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990], [56014].
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56019
git-svn-id: http://core.svn.wordpress.org/trunk@55531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add labels; change Enter new/Cancel link to a button; move focus to input when creating new field; move Add Custom Field out of fields table.
Props jane, batmoo, karmatosed, franrosa, sabernhardt, annashopina, oglekler, joedolson.
Fixes#15631.
Built from https://develop.svn.wordpress.org/trunk@56018
git-svn-id: http://core.svn.wordpress.org/trunk@55530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prior to PHP 7.0, `substr( '', -0, 0 )` returns `false` instead of an empty string, so the strict comparison further in the function did not work as expected.
This commit addresses a test failure on PHP < 7.0, making the function consistently return `true` if both haystack and needle are an empty string.
Follow-up to [52040], [56014], [56015].
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56016
git-svn-id: http://core.svn.wordpress.org/trunk@55528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a warning on PHP < 7.2.18 if haystack is an empty string:
{{{
Warning: substr_compare(): The start position cannot exceed initial string length
}}}
Follow-up to [52040], [55158], [55990], [56014].
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56015
git-svn-id: http://core.svn.wordpress.org/trunk@55527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_ends_with()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) ends with the given substring (needle).
WordPress core includes a polyfill for `str_ends_with()` on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990].
See #58220.
Built from https://develop.svn.wordpress.org/trunk@56014
git-svn-id: http://core.svn.wordpress.org/trunk@55526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since both functions return the exact same thing, this changeset makes `twentyseventeen_is_static_front_page()` an alias of `twentyseventeen_is_frontpage()`
and updates the related docblocks and function callback.
Props mukesh27, soulseekah, swissspidy, sabernhardt, audrasjb, SergeyBiryukov, hareesh-pillai.
Fixes#43515.
Built from https://develop.svn.wordpress.org/trunk@56012
git-svn-id: http://core.svn.wordpress.org/trunk@55524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset improves `update.js` by adding `is-enqueued` class to enqueued plugin updates to prevent users from asking for several updates for the same
plugin at the same time, which previously resulted to …an interesting experience.
Props bitnissen, swissspidy, MarcGuay, xkon, afercia, swissspidy, bookdude13, simonemanfre, vasilism, costdev, zunaid321.
Fixes#40966.
Built from https://develop.svn.wordpress.org/trunk@56009
git-svn-id: http://core.svn.wordpress.org/trunk@55521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a show/hide toggle for new passwords in initial user creation and database access during install and setup process using the same model as on user profiles. Add a new password toggle script. Change setup config table to two columns, matching the install table layout.
Props xmarcos, matt, markjaquith, nazgul, akbigdog, intoxination, rob1n, MichaelH, empireoflight, rmccue, markoheijnen, r0uter, amansurov, bi0xid, DrewAPicture, Narthur, wpnook, markparnell, costdev, clorith, ryokuhi, sabernhardt, bgoewert, ironprogrammer, adeltahri, joedolson, mukesh27, audrasjb, sergeybiryukov.
Fixes#3534.
Built from https://develop.svn.wordpress.org/trunk@56008
git-svn-id: http://core.svn.wordpress.org/trunk@55520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes a bug where WordPress core's own block editor styles (`wp-block-{$block_name}-editor`) were referencing the same CSS files as their frontend equivalents (`wp-block-{$block_name}`). This would result in incorrect frontend styles potentially being loaded in the block editor.
Tests for the related logic have been added.
Props flixos90, joemcgill, mukesh27, spacedmonkey.
Fixes#58605.
Built from https://develop.svn.wordpress.org/trunk@56005
git-svn-id: http://core.svn.wordpress.org/trunk@55517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replace use of `list` to parse array keys into variables. `list` throws errors if the keys don't exist, and many extenders will not define the new array keys. The code path already falls back effectively for empty values.
Also add translator comments to screen reader hidden text, fix a docblock, and fix an HTML error.
Follow up to [r55971].
Props kebbet, chouby, joedolson.
Fixes#32170.
Built from https://develop.svn.wordpress.org/trunk@56004
git-svn-id: http://core.svn.wordpress.org/trunk@55516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids fatal errors on PHP < 8.0 if the file is included via `wp-admin/load-scripts.php` or `wp-admin/load-styles.php`, in which case the polyfills from `wp-includes/compat.php` are not loaded.
Follow-up to [55703], [55710], [55988].
Props ryelle.
See #58206.
Built from https://develop.svn.wordpress.org/trunk@56002
git-svn-id: http://core.svn.wordpress.org/trunk@55514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since the `$auto_upgrade_notice` has been added to the `update-core.php` table listing if an `$upgrade_notice` is present by virtue of the `readme.txt`
containing data in the `== Upgrade Notice ==` section, this text will appear in between the compatibility information and the auto update information.
This changeset provides a more consistent appearance in the interface.
Props afragen, costdev, zunaid321.
Fixes#57939.
Built from https://develop.svn.wordpress.org/trunk@56001
git-svn-id: http://core.svn.wordpress.org/trunk@55513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids fatal errors on PHP < 8.0 if the file is included directly outside of WordPress core, e.g. by HyperDB.
While WordPress core does include polyfills for these functions, they are not directly loaded in the `wpdb` class.
Follow-up to [54384], [55157], [55158], [55988], [55990].
Props dd32, ryelle, joedolson.
See #58206.
Built from https://develop.svn.wordpress.org/trunk@55994
git-svn-id: http://core.svn.wordpress.org/trunk@55506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Modify the E2E workflow to store the screenshots and HTML files generated during failing tests as an artifact in the workflow.
No artefact is stored for passing test runs.
Props peterwilsoncc, isabel_brison.
Fixes#58596.
Built from https://develop.svn.wordpress.org/trunk@55991
git-svn-id: http://core.svn.wordpress.org/trunk@55503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
This commit uses `str_starts_with()` and `str_ends_with()` in core files where appropriate:
* `$needle === substr( $string, 0, $length )`, where `$length` is the length of `$needle`, is replaced with `str_starts_with( $haystack, $needle )`.
* `$needle === substr( $string, $offset )`, where `$offset` is negative and the absolute value of `$offset` is the length of `$needle`, is replaced with `str_ends_with( $haystack, $needle )`.
This aims to make the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [52039], [52040], [52326], [55703], [55710], [55987], [55988].
Props Soean, spacedmonkey, Clorith, ocean90, azaozz, sabernhardt, SergeyBiryukov.
Fixes#58220.
Built from https://develop.svn.wordpress.org/trunk@55990
git-svn-id: http://core.svn.wordpress.org/trunk@55502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [52039], [52040], [52326], [55703], [55710], [55987].
Props Soean, spacedmonkey, costdev, dingo_d, azaozz, mikeschroder, flixos90, peterwilsoncc, SergeyBiryukov.
Fixes#58206.
Built from https://develop.svn.wordpress.org/trunk@55988
git-svn-id: http://core.svn.wordpress.org/trunk@55500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the code more readable and consistent, as the function is already used extensively in core files.
WordPress core includes a polyfill for `str_starts_with()` on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55703], [55959].
Props spacedmonkey.
Fixes#58012.
Built from https://develop.svn.wordpress.org/trunk@55987
git-svn-id: http://core.svn.wordpress.org/trunk@55499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset improve Dashboard screen options by stacking them vertically on small screens.
Props dhrumilk, prashantbhivsane, marybaum, dhruvishah2203, ababir, mukesh27, chiragrathod103, oglekler, tb1909, jahidcse, audrasjb.
Fixes#57977.
Built from https://develop.svn.wordpress.org/trunk@55984
git-svn-id: http://core.svn.wordpress.org/trunk@55496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.
It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), and removes IE specific code from `header.php`.
Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@55982
git-svn-id: http://core.svn.wordpress.org/trunk@55494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.
It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), removes IE-specific code in general stylesheets, and removes IE specific code
from Customizer, header.php and custom-header.php.
Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@55981
git-svn-id: http://core.svn.wordpress.org/trunk@55493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.
It also replace the content of `html5.js` shiv with a comment (to avoid 404s) and removes IE-specific code in general stylesheets.
Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@55980
git-svn-id: http://core.svn.wordpress.org/trunk@55492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update the performance tests to account for the relocation of the theme unit test data repository to the WordPress organisation on GitHub.
Props costdev, kafleg, williampatton, dd32, otto42, poena, jrf, joemcgill, peterwilsoncc, mukesh27.
Fixes#58569.
Built from https://develop.svn.wordpress.org/trunk@55976
git-svn-id: http://core.svn.wordpress.org/trunk@55488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Hide the password for the "Post via e-mail" settings in writing options. Use the same password hiding mechanisms in use elsewhere in core.
Props mastrup, denis-de-bernardy, ryan, brookedot, wojtek.szkutnik, dd32, sabreuse, sergeybiryukov, costdev, peterwilsoncc, zgrkaralar, clorith, renyot, sabernhardt, boniu91, ironprogrammer, bgoewert.
Fixes#9883.
Built from https://develop.svn.wordpress.org/trunk@55974
git-svn-id: http://core.svn.wordpress.org/trunk@55486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Implement `aria-sort` and change icon states to indicate current sort for list tables. Allow screen reader users to get context about the current sort and allow sighted users to know how the table is currently sorted.
Props afercia, rianrietveld, joedolson, alexstine, johnjamesjacoby.
Fixes#32170.
Built from https://develop.svn.wordpress.org/trunk@55971
git-svn-id: http://core.svn.wordpress.org/trunk@55483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset improves a JS conditional statement to fix a console error thrown by Firefox on `event.target.matches`.
Props kjellr, laurelfulford, audrasjb, dimijazz, ianbelanger, pbiron, poena, McAlyster, janpaulkleijn, swissspidy, mukesh27, rehanali.
Fixes#46474.
See #45903 (fixes one of the two issues of this ticket).
Built from https://develop.svn.wordpress.org/trunk@55970
git-svn-id: http://core.svn.wordpress.org/trunk@55482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As placeholders may introduce confusion about whether the example is the input's predefined value or not, this changeset moves the "Just another WordPress
site" historic tagline as an example quoted in the field's description.
Props Cybr, audrasjb, sabernhardt, pavanpatil1, tb1909.
Fixes#57675.
Built from https://develop.svn.wordpress.org/trunk@55969
git-svn-id: http://core.svn.wordpress.org/trunk@55481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The intention behind this change is to prevent sensitive data in responses for logged in users being cached and available to others, for example via the browser history after the user logs out.
The `no-store` directive instructs caches in the browser or within proxies not to store the response in the cache. This is subtly different from the `no-cache` directive which means the response can be cached but must be revalidated before re-use. WordPress does not use ETag headers by default therefore this does not achieve the same result.
The `private` directive complements the `no-store` directive by specifying that the response contains private information that should not be stored in a public cache. Som
e proxy caches may ignore the `no-store` directive but respect the `private` directive, thus it is included.
The existing `Cache-Control` header for users who are not logged in remains unchanged, and the existing cache prevention directives remain in place for backwards compatib
ility.
Props soulseekah, luehrsen, Dharm1025, markdoliner, rutviksavsani, ayeshrajans, paulkevan, clorith, andy786, johnbillion
Fixes#21938, Fixes#57627
Built from https://develop.svn.wordpress.org/trunk@55968
git-svn-id: http://core.svn.wordpress.org/trunk@55480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes unused parameters and variables, fixes a typo, and improves some docblocks as per documentation standards.
Props upadalavipul, mukesh27, costdev, sabernhardt, hellofromtonya, audrasjb.
Fixes#57397.
Built from https://develop.svn.wordpress.org/trunk@55963
git-svn-id: http://core.svn.wordpress.org/trunk@55475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because `update_menu_item_cache` parameter doesn't have any description in this function, the `wp_get_nav_menu_items()` documentation page on DevHub fallbacks
to `get_post()` params descriptions… which fallbacks to `parse_query()`.
In parse_query(), the `update_menu_item_cache` param is set to `false` by default, so `wp_get_nav_menu_items()` ends up with a value of `false` by default,
which is wrong since `wp_get_nav_menu_items()` overrides this parameter to set it to true by default.
This changeset adds `update_menu_item_cache` parameter to `wp_get_nav_menu_items()` docblock, and indicates that it is set to `true` by default.
Follow-up to [53504].
Props audrasjb, matmoe.
Fixes#58468.
See #57840.
Built from https://develop.svn.wordpress.org/trunk@55962
git-svn-id: http://core.svn.wordpress.org/trunk@55474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On the `<body>` element, as a best practice background color and text color should always be set together. This makes it easier to quickly understand the
underlying color scheme.
Props allancole, joyously, samful, sabernhardt, oglekler, ronakganatra, tb1909, ugyensupport.
Fixes#45916.
Built from https://develop.svn.wordpress.org/trunk@55960
git-svn-id: http://core.svn.wordpress.org/trunk@55472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the `label` for `.check-column` inside list tables to a block filling the entire cell. Improves accessibility by increasing the target area for the control.
Props mitchoyoshitaka, lessbloat, sabernhardt, ogleker, tacoverdo, joostdevalk, karmatosed.
Fixes#21516.
Built from https://develop.svn.wordpress.org/trunk@55954
git-svn-id: http://core.svn.wordpress.org/trunk@55466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a `is_block_theme` property to each theme in the `wp/v2/themes` API response, which uses `WP_Theme::is_block_theme` to determinate whether
the theme is block theme or not.
Props grantmkin, ironprogrammer, zunaid321, azaozz, spacedmonkey, audrasjb, costdev.
Fixes#58123.
Built from https://develop.svn.wordpress.org/trunk@55951
git-svn-id: http://core.svn.wordpress.org/trunk@55463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `WP_Theme_JSON::append_to_selector()` method was previously used for both appending and prepending which violated the single responsibility principle. It resulted in additional conditionals which also came at a performance cost, particularly because the method is called over 1,000 times during a regular WordPress request.
With the new `WP_Theme_JSON::prepend_to_selector()` method, there are now two distinct methods for the two distinct purposes. The now useless third parameter on `WP_Theme_JSON::append_to_selector()` has been removed (rather than deprecated), which is acceptable given that it is a protected method on a class that is not intended for extensions.
Props bor0, costdev, flixos90, isabel_brison, oandregal, spacedmonkey.
Fixes#58193.
See #58457.
Built from https://develop.svn.wordpress.org/trunk@55950
git-svn-id: http://core.svn.wordpress.org/trunk@55462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Due to partially duplicated logic for displaying row actions in the Media Library with and without the “Unattached” filter, the “Copy URL” and “Download file” row actions were unintentionally missing with the filter applied.
This commit aims to simplify the logic and bring more consistency to the code.
Includes displaying the “Download file” row action even when the “Trash” filter is applied, giving the user one more chance to download the media file before they delete it.
Follow-up to [8901], [13100], [16227], [16229], [52842], [55198], [55221].
Props kebbet, costdev, pbiron, oglekler, SergeyBiryukov.
Fixes#57890, #57893.
Built from https://develop.svn.wordpress.org/trunk@55949
git-svn-id: http://core.svn.wordpress.org/trunk@55461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Redirect users visiting the `wp-admin/media.php` file to the media library, `wp-admin/upload.php`. An user facing warning is displayed when the media library is reached via a deprecated link.
Follow up to [55647].
Props jorbin, audrasjb, azaozz, NekoJonez, kebbet, costdev.
Fixes#57612.
Built from https://develop.svn.wordpress.org/trunk@55943
git-svn-id: http://core.svn.wordpress.org/trunk@55455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change check to see if the current theme is a block theme, to check the path `/templates/index.html` first over the deprecated path `/block-templates/index.html`.
As this path was deprecated in WP 5.9, it is more likely the block theme would use the current path. This saves a file_exists call which improves performance.
Props nihar007, spacedmonkey.
Fixes#58520.
Built from https://develop.svn.wordpress.org/trunk@55941
git-svn-id: http://core.svn.wordpress.org/trunk@55453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `usermeta` group was introduced in WP 2.0, but was never actually used in WordPress core.
The `user_meta` group is used instead.
Follow-up to [3011], [15482], [16562], [53823], [53832], [54940].
Props ignatggeorgiev, peterwilsoncc, oglekler, pamprn09, spacedmonkey, SergeyBiryukov.
Fixes#58175.
Built from https://develop.svn.wordpress.org/trunk@55940
git-svn-id: http://core.svn.wordpress.org/trunk@55452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix an edge case caching issue, where if a developer use the `wp_cache_themes_persistently` filter and is running the site in multisite configuration, it meant block template are incorrectly cached. Block templates are stored in the posts table. But in a multisite configuration, different sites on the multisite could have different block templates stored in there post table. As themes cache group is a global group, it resulted in incorrect values being cached.
Props maniu, spacedmonkey, hellofromTonya, oglekler, mukesh27, joemcgill.
Fixes#57886.
Built from https://develop.svn.wordpress.org/trunk@55939
git-svn-id: http://core.svn.wordpress.org/trunk@55451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a check to the start of `copy_dir()` that the destination directory exists and attempts to create it if it does not.
An error is returned if the directory can not be created, either due to a permissions error or the parent directory not existing.
Props caraffande, costdev, zunaid321.
Fixes#41855.
Built from https://develop.svn.wordpress.org/trunk@55938
git-svn-id: http://core.svn.wordpress.org/trunk@55450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the log in link that appears after completing installation so that it does not use the button styling. Links should look like links.
Props xavortm, menakas, afercia, rianrietveld, johnbillion, drw158, joedolson.
Fixes#40470.
Built from https://develop.svn.wordpress.org/trunk@55933
git-svn-id: http://core.svn.wordpress.org/trunk@55445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the button block in Twenty Fourteen to use relative instead of fixed line-height. Prevent visual errors with larger font sizes on the front-end.
Props nidhidhandhukiya, algorithmsunlocks, mayur8991, sabernhardt.
Fixes#58444.
Built from https://develop.svn.wordpress.org/trunk@55932
git-svn-id: http://core.svn.wordpress.org/trunk@55444 1a063a9b-81f0-0310-95a4-ce76da25c4cd