WordPress 5.2 adds the `wp_body_open()` function, and the default themes make use of it. This patch adds a shim for `wp_body_open` to bundled themes so this function will also work in older versions of WordPress.
Props lgedeon, johnbillion, timph, ramiy, pento.
Fixes#46679.
Built from https://develop.svn.wordpress.org/trunk@45256
git-svn-id: http://core.svn.wordpress.org/trunk@45065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This reduces the potential email noise to places where the fatal error could be interfering with the login and admin experience.
Once the user is in recovery mode, any fatal errors (even if they aren't in a protected endpoint) are handled and the plugin or theme will be paused.
Props TimothyBlynJacobs.
See #46950.
Built from https://develop.svn.wordpress.org/trunk@45238
git-svn-id: http://core.svn.wordpress.org/trunk@45047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This significantly reduces the number of SQL queries when `wp_list_authors()` is called on a site where the majority of users don't have any posts, e.g. a membership site.
Props billerickson, ianbelanger, dswebsme.
Fixes#45105.
Built from https://develop.svn.wordpress.org/trunk@45235
git-svn-id: http://core.svn.wordpress.org/trunk@45044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Per the documentation standards, the `@global` tag is meant to list PHP globals used within functions or methods.
The code in question uses the variable in global namespace, but does not explicitly declare it.
Props jayupadhyay01, dswebsme.
Fixes#46602.
Built from https://develop.svn.wordpress.org/trunk@45233
git-svn-id: http://core.svn.wordpress.org/trunk@45042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These keys are used in `{$type}_template_hierarchy` and `{$type}_template` filters.
Previously, `front_page` and `privacy_policy` were passed, but `get_query_template()` stripped the underscores before passing the values to the filters.
Props rinatkhaziev, tmatsuur, johnbillion.
Fixes#21213, #46958.
Built from https://develop.svn.wordpress.org/trunk@45231
git-svn-id: http://core.svn.wordpress.org/trunk@45040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Currently, there are a number of scenarios where `is_block_editor()` (and `WP_Screen::is_block_editor`) would incorrectly indicate block editor support at different points of the loading process. Most notably, checking `is_block_editor` when hooking into the `current_screen` action will always result in `false`, even when the block editor is being loaded. This is because `is_block_editor` is not set to `true` until `edit-form-blocks.php` is included.
This change adds logic to `WP_Screen` to ensure the accuracy of `is_block_editor` on block editor pages earlier in the load process.
While edit screens will now be accurate 100% of the time from `current_screen` on, there are still a few edge cases where `is_block_editor` could contain an incorrect value when creating a new post.
Because a `WP_Post` object is a required parameter for the `replace_editor` filter and `use_block_editor_for_post()` function, `WP_Screen` will fall back to the value returned by `use_block_editor_for_post_type()` for the post being created. To eliminate these edge cases, the `use_block_editor_for_post_type` filter can be used to return the appropriate boolean value to indicate support.
Props Chouby, desrosj, aduth, johnbillion.
Fixes#46195.
Built from https://develop.svn.wordpress.org/trunk@45224
git-svn-id: http://core.svn.wordpress.org/trunk@45033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Change `recurse_dirsize()` to accept an array of excluded paths.
- Change so we don't calculate the sizes of dirs in wp-content twice.
- Add the size in bytes to the "debug" into.
- Add a custom DOM event after the dir sizes request is done. Can be used by plugins to "daisy chain" more requests.
- Move "WordPress directory location" and "WordPress directory size" to the top in the "Directories and Sizes" section.
- Move "Theme directory location" to the "Active Theme" section.
- Fix labels capitalization.
Props xkon, afercia, Clorith, azaozz.
Fixes#46707.
Built from https://develop.svn.wordpress.org/trunk@45220
git-svn-id: http://core.svn.wordpress.org/trunk@45029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For many bundled theme related stylesheets, a version is either not specified, or specified as a hardcoded date string when enqueued. This is problematic when a stylesheet is updated and the version number is not (which has happened several times recently). This change ensures that all bundled theme related stylesheets use the theme’s version as the stylesheet version. This ensures cache busting for theme stylesheets every time a theme is updated and guarantees that users receive any new or updated styles included in the update when visiting the site for the first time after an update.
Props parsmizban, ianbelanger, dswebsme.
Fixes#39997.
Built from https://develop.svn.wordpress.org/trunk@45213
git-svn-id: http://core.svn.wordpress.org/trunk@45022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While currently a recovery link is only made available via the admin email address, this will be expanded in the future. In order to accomplish that, the mechanisms to store and validate recovery keys must support multiple keys to be valid at the same time.
This changeset adds that support, adding an additional token parameter which is part of a recovery link in addition to the key. A key itself is always associated with a token, so the two are only valid in combination. These associations are stored in a new `recovery_keys` option, which is regularly cleared in a new Cron hook, to prevent potential cluttering from unused recovery keys.
This changeset does not have any user-facing implications otherwise.
Props pbearne, timothyblynjacobs.
Fixes#46595. See #46130.
Built from https://develop.svn.wordpress.org/trunk@45211
git-svn-id: http://core.svn.wordpress.org/trunk@45020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that at least for the admin, which is more predictable than the frontend, the user-friendlier error notice from the fatal error handler still shows if a runtime fatal error happens within the page generation process.
Props axaak.
Fixes#46811.
Built from https://develop.svn.wordpress.org/trunk@45210
git-svn-id: http://core.svn.wordpress.org/trunk@45019 1a063a9b-81f0-0310-95a4-ce76da25c4cd