This change adds a CSS exception for when the "Dashboard" heading is missing or located below the Welcome Panel.
Props critterverse, sabernhardt, rolfsiebers, audrasjb.
Fixes#54977.
git-svn-id: https://develop.svn.wordpress.org/trunk@52735 602fd350-edb4-49c9-b593-d223f7449a82
#38231 added support for files fetched remotely to have their filename defined by the host using the `Content-Disposition` header. This would then take priority over the existing temporary file name created with `wp_tempnam()` earlier in the process.
The change unintentionally omitted the temporary directory path used during uploads, since the `wp_tempnam()` function would have added it previously, so that files with this header ended up being stored in the WordPress root folder, or wp-admin folder, when triggered by WP_Cron or user interactions respectively.
This change makes sure the file path includes the temporary directory location when the header is used.
Follow-up to [51939].
Props antonynz, azouamauriac.
Fixes#55109.
git-svn-id: https://develop.svn.wordpress.org/trunk@52734 602fd350-edb4-49c9-b593-d223f7449a82
Since WordPress 5.9 you can set a view script for a block which is supposed to be only loaded on the front end. Unfortunately it's currently also loaded in the editor which can cause unexpected behaviour and also performance issues depending on the size of the scripts.
This is caused by the preloading of REST API routes via `block_editor_rest_api_preload()` which doesn't happen in an encapsulated process and so does pollute any global state like the one for scripts and styles.
Similar to the global `$post`, core now backups the globals `$wp_scripts` and `$wp_styles` and restores the backup after the preloading.
Props gziolo, ocean90.
Fixes#55151.
git-svn-id: https://develop.svn.wordpress.org/trunk@52733 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes an issue in the Widgets editor: widgets group was missing a `.wp-widget-group__inner-blocks` container.
Props noisysocks, ironprogrammer.
Fixes#55072.
git-svn-id: https://develop.svn.wordpress.org/trunk@52730 602fd350-edb4-49c9-b593-d223f7449a82
This change removes some overrides that prevented site editor updates in 5.9 from controlling vertical margins via `var(--global--spacing-vertical)`.
Props stacimc, Boniu91, aristath, ironprogrammer, nidhidhandhukiya.
Fixes#54250.
git-svn-id: https://develop.svn.wordpress.org/trunk@52726 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the attachment was silently removed from the grid but reappeared after a page reload.
Follow-up to [22869].
Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov.
Fixes#55158.
git-svn-id: https://develop.svn.wordpress.org/trunk@52725 602fd350-edb4-49c9-b593-d223f7449a82
This change implements gradient background options that fit the color scheme used in Twenty Fifteen.
Props ianbelanger, itsamoreh, pls78, audrasjb.
Fixes#49760.
git-svn-id: https://develop.svn.wordpress.org/trunk@52724 602fd350-edb4-49c9-b593-d223f7449a82
* Use strict comparison in various conditions.
* Fix a `Variable "$system_webServer_node" is not in valid snake_case format` WPCS warning.
Includes minor code layout fixes for better readability.
Follow-up to [10607], [11350], [22253], [26137].
Props azouamauriac, SergeyBiryukov.
See #54728.
git-svn-id: https://develop.svn.wordpress.org/trunk@52721 602fd350-edb4-49c9-b593-d223f7449a82
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.
Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.
Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].
Follow-up to [50810], [52696], [52698], [52701].
Props maxkellermann.
See #55069.
git-svn-id: https://develop.svn.wordpress.org/trunk@52718 602fd350-edb4-49c9-b593-d223f7449a82
This appears to be redundant, as none of the functions used inside the block throw an exception.
Follow-up to [50810].
See #54728.
git-svn-id: https://develop.svn.wordpress.org/trunk@52717 602fd350-edb4-49c9-b593-d223f7449a82
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`
This aims to provide more details about the returned value types.
Follow-up to [52700], [52702], [52703].
See #54729, #54574.
git-svn-id: https://develop.svn.wordpress.org/trunk@52708 602fd350-edb4-49c9-b593-d223f7449a82
Implement the `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple` in a number of core functions after they were introduced in [52700]
Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.
git-svn-id: https://develop.svn.wordpress.org/trunk@52707 602fd350-edb4-49c9-b593-d223f7449a82
The original order was alphabetical, which became less obvious as newer functions got added, resulting in a somewhat random order.
This commits aims to organize the functions and related `WP_Object_Cache` methods in a more predictable order:
* `wp_cache_init()`
* `wp_cache_add()`
* `wp_cache_add_multiple()`
* `wp_cache_replace()`
* `wp_cache_set()`
* `wp_cache_set_multiple()`
* `wp_cache_get()`
* `wp_cache_get_multiple()`
* `wp_cache_delete()`
* `wp_cache_delete_multiple()`
* `wp_cache_incr()`
* `wp_cache_decr()`
* `wp_cache_flush()`
* `wp_cache_close()`
* `wp_cache_add_global_groups()`
* `wp_cache_add_non_persistent_groups()`
* `wp_cache_switch_to_blog()`
* `wp_cache_reset()`
Follow-up to [3011], [6543], [7986], [13066], [18580], [21403], [47938], [52700], [52703-52705].
See #54728, #54574.
git-svn-id: https://develop.svn.wordpress.org/trunk@52706 602fd350-edb4-49c9-b593-d223f7449a82
While this was previously added and reverted more than once as part of various documentation cleanup efforts, `wp_cache_switch_to_blog()` appears to be the correct alternative for `wp_cache_reset()`, per the latter's DocBlock.
This commit also corrects the `@deprecated` tag for `WP_Object_Cache::reset()` to link to the `::switch_to_blog()` method of the class, instead of the function of the same name.
Follow-up to [13066], [21403], [22111], [33678], [34225], [34226], [40929].
See #54729.
git-svn-id: https://develop.svn.wordpress.org/trunk@52705 602fd350-edb4-49c9-b593-d223f7449a82
These appear to be a copy/paste from the `wp_cache_get_multiple()` test and are not required here.
Follow-up to [47938], [52700].
See #54574.
git-svn-id: https://develop.svn.wordpress.org/trunk@52702 602fd350-edb4-49c9-b593-d223f7449a82
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.
Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.
Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].
Follow-up to [50810], [52696], [52698].
Props maxkellermann.
See #55069.
git-svn-id: https://develop.svn.wordpress.org/trunk@52701 602fd350-edb4-49c9-b593-d223f7449a82
Add new caching functions named `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple`. All of these functions allow for an array of data to be passed, so that multiple cache objects can be created / edited / deleted in a single function call. This follows on from [47938] where the `wp_cache_get_multiple` function was introduced and allowed for multiple cache objects to be received in one call.
Props: spacedmonkey, tillkruess, adamsilverstein, flixos90, mitogh, pbearne.
Fixes: #54574.
git-svn-id: https://develop.svn.wordpress.org/trunk@52700 602fd350-edb4-49c9-b593-d223f7449a82
When providing file paths to scripts (editorScript, script or viewScript), when there is a trailing ./ included then there was a different md5 generated for the file that didn't match the one used with the file generated in the translations folder.
Props Rahe.
See #54797.
git-svn-id: https://develop.svn.wordpress.org/trunk@52699 602fd350-edb4-49c9-b593-d223f7449a82
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.
Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.
Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].
Follow-up to [12044], [49073], [52696].
Props maxkellermann.
See #55069.
git-svn-id: https://develop.svn.wordpress.org/trunk@52698 602fd350-edb4-49c9-b593-d223f7449a82
This change improves performance for classic themes by removing an unnecessary query and fixes an issue where a classic theme would show "Empty template: Index" on the frontend when an empty `(block-)templates/index.html` file exists.
Props johnbillion, ianatkins, Mamaduka, costdev, manfcarlo, dolphingg, audrasjb, madeinua, kapilpaul, rafiahmedd, SergeyBiryukov.
Fixes#54844.
git-svn-id: https://develop.svn.wordpress.org/trunk@52697 602fd350-edb4-49c9-b593-d223f7449a82
`stream_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.
Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.
Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].
Follow-up to [12174].
Props maxkellermann.
See #55069.
git-svn-id: https://develop.svn.wordpress.org/trunk@52696 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes an issue where `_wp_normalize_relative_css_links()` was not only matching urls, but also HTML IDs.
Follow-up to [52036].
Props mahype, costdev, audrasjb, SergeyBiryukov.
Fixes#54922.
git-svn-id: https://develop.svn.wordpress.org/trunk@52695 602fd350-edb4-49c9-b593-d223f7449a82
Prevent the transient setters and getters from attempting to use the database table before they exist during the installation process.
During installation transients now use the `wp_cache_*()` functions on all sites, including those without a persistent cache, to prevent database errors. The use of the caching functions stores the data in memory for the duration of the request to account for transient data that is used multiple times during installation.
Props dd32, audrasjb, tnolte, antonvlasenko, noisysocks, peterwilsoncc.
Fixes#54849.
git-svn-id: https://develop.svn.wordpress.org/trunk@52694 602fd350-edb4-49c9-b593-d223f7449a82
This makes it easier to determine in a callback function whether this is an existing post being updated or not.
Follow-up to [8635], [8702], [27130], [27138], [28106], [28788], [47633].
Props nhadsall, mukesh27.
Fixes#46228.
git-svn-id: https://develop.svn.wordpress.org/trunk@52691 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes a typo in the "Left-aligned Large Quote" block pattern.
Props tobifjellner, rafiahmedd, mukesh27.
Fixes#55099.
git-svn-id: https://develop.svn.wordpress.org/trunk@52690 602fd350-edb4-49c9-b593-d223f7449a82
This brings the naming more in line with other variables like `$current_user`.
Follow-up to [2872].
See #54728.
git-svn-id: https://develop.svn.wordpress.org/trunk@52689 602fd350-edb4-49c9-b593-d223f7449a82
This change partially reverts [52679] which accidentally removed custom padding for group blocks with a background color.
Follow-up to [52679].
Props kjellr.
Fixes#55103.
See #54944.
git-svn-id: https://develop.svn.wordpress.org/trunk@52686 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes a consistency issue where "Pigeon" was a h3, while "Sparrow" and "Falcon" were h2. Let's treat these birds equally 🐦
Props kjellr, jffng.
Fixes#54929.
git-svn-id: https://develop.svn.wordpress.org/trunk@52681 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.
Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast.
Fixes#54944.
git-svn-id: https://develop.svn.wordpress.org/trunk@52679 602fd350-edb4-49c9-b593-d223f7449a82
This replaces instances of `assertTrue( str_contains( ... ) )` with `assertStringContainsString()` to use native PHPUnit functionality.
Follow-up to [52675], [52676].
See #54782.
git-svn-id: https://develop.svn.wordpress.org/trunk@52677 602fd350-edb4-49c9-b593-d223f7449a82
Use multi-line comment syntax for some comments, per the documentation standards.
Follow-up to [52675].
See #54782.
git-svn-id: https://develop.svn.wordpress.org/trunk@52676 602fd350-edb4-49c9-b593-d223f7449a82
This commit makes the presets provided by the theme via add_theme_support always create CSS Custom Properties, whether or not the theme has a theme.json file. This way, if the overwrites a core preset, the core CSS variables are also overwritten and use the theme value.
Props oandregal, hellofromTonya, desrosj, costdev, pbearne, johnstonphilip, webmandesign.
Fixes#54782.
git-svn-id: https://develop.svn.wordpress.org/trunk@52675 602fd350-edb4-49c9-b593-d223f7449a82
This change replaces `display: none` with `screen-reader-text` styles so the text labels are available for screen readers on small screens.
Props legendusmaximus, sabernhardt, konradyoast.
Fixes#54895.
git-svn-id: https://develop.svn.wordpress.org/trunk@52674 602fd350-edb4-49c9-b593-d223f7449a82
Updating the version string will help invalidate caches, ensuring the new version of the library is loaded where applicable.
Follow-up to [52429].
Props david.binda.
Fixes#54904.
git-svn-id: https://develop.svn.wordpress.org/trunk@52673 602fd350-edb4-49c9-b593-d223f7449a82
Prevent blank notices from appearing when adding custom fields or terms in the post editor.
Props gadhiyaravi, Boniu91, ravipatel, sabernhardt.
Fixes#54955. See #42937.
git-svn-id: https://develop.svn.wordpress.org/trunk@52672 602fd350-edb4-49c9-b593-d223f7449a82
Checks that the media collection has a mirroring property before accessing the property in media views.
Props MMDeveloper, mukesh27.
Fixes#53856.
git-svn-id: https://develop.svn.wordpress.org/trunk@52671 602fd350-edb4-49c9-b593-d223f7449a82
Remove the one day expiry limitation from query caches found in the `WP_Term_Qurery` class. Removing this limitation means that the caches will remain in object caching, as long as possible. Ensure that all term / taxonomy cache clear functions invalidate query caches, by deleting the last_changed value in the terms cache group.
Props spacedmonkey, adamsilverstein, boonebgorges, tillkruess, dlh, flixos90.
Fixes#54511.
git-svn-id: https://develop.svn.wordpress.org/trunk@52669 602fd350-edb4-49c9-b593-d223f7449a82
In [52158] the standard post type UI was added back for templates and template parts, because these features had been temporarily removed from the site editor in the rush to get 5.9 ready for December. Since 5.9 these features were properly added back to the site editor, the `show_ui` values for these post types should be returned back to `false`.
Follow-up to [52158].
Props manfcarlo, audrasjb.
Fixes#54908.
git-svn-id: https://develop.svn.wordpress.org/trunk@52668 602fd350-edb4-49c9-b593-d223f7449a82