Prevent `get_post_status()` returning `false` for attachments if the parent post has been deleted. The returned attachment post status is now passed through the `get_post_status` filter.
Add tests for `get_post_status()`.
Props peterwilsoncc, timothyblynjacobs for review.
Fixes#52326.
git-svn-id: https://develop.svn.wordpress.org/trunk@49985 602fd350-edb4-49c9-b593-d223f7449a82
Related Gutenberg issue: https://github.com/WordPress/gutenberg/pull/28274
With this change it is going to be possible to use the same pattern that wp_style_add_data uses for RTL handling. If the block style file with "-rtl.css" is included in addition to the regular style referenced in "block.json" file then it is going to be automatically registered.
Props swisspidy, aristath.
See #52301.
git-svn-id: https://develop.svn.wordpress.org/trunk@49982 602fd350-edb4-49c9-b593-d223f7449a82
Previously, attachments without an author could cause a PHP fatal error due to calling the `::exists()` method on a `false` value.
Props antpb, carloscastilloadhoc, hellofromTonya, garrett-eclipse.
Fixes#52030.
git-svn-id: https://develop.svn.wordpress.org/trunk@49979 602fd350-edb4-49c9-b593-d223f7449a82
This replaces "user privacy" in various error messages with "personal data", for consistency with other existing strings.
Follow-up to [49090].
Props xkon, transl8or.
Fixes#51849.
git-svn-id: https://develop.svn.wordpress.org/trunk@49970 602fd350-edb4-49c9-b593-d223f7449a82
The array received or returned by these functions is not always an array of strings, for example when slashing or unslashing an array of arrays.
Follow-up to [47400], [48441], [49926].
Props johnbillion.
See #51800.
git-svn-id: https://develop.svn.wordpress.org/trunk@49968 602fd350-edb4-49c9-b593-d223f7449a82
The `is_network_only_plugin` and `is_plugin_active` functions are not available in a front-end context and must be specifically loaded.
Props oakesjosh.
Fixes#52205.
git-svn-id: https://develop.svn.wordpress.org/trunk@49952 602fd350-edb4-49c9-b593-d223f7449a82
Per accessibility best practices, it is recommended that all HTML `<img>` elements have an `alt` attribute. Any decorative images should have an empty `alt` attribute (`alt=""`).
Props laxman-prajapati, sabernhardt, audrasjb.
Fixes#51846.
git-svn-id: https://develop.svn.wordpress.org/trunk@49949 602fd350-edb4-49c9-b593-d223f7449a82
Adds 2 new hooks in `register_block_type_from_metadata`:
- Named `block_type_metadata` to filter the content of metadata read from `block.json`
- Named `block_type_metadata_settings` to filter the settings object determined from the metadata that is passed to `register_block_type` call
Props swissspidy.
Fixes#52138.
git-svn-id: https://develop.svn.wordpress.org/trunk@49948 602fd350-edb4-49c9-b593-d223f7449a82
The function simply converts a comma- or space-separated list of scalar values to an array and does not perform any sanitization on its own.
Follow-up to [44546].
Props johnjamesjacoby.
See #51800.
git-svn-id: https://develop.svn.wordpress.org/trunk@49941 602fd350-edb4-49c9-b593-d223f7449a82
`WP_Hook::has_filter()` returns true if `$function_to_check` is omitted and the hook being checked has one or more registered callbacks.
Follow-up to [49927].
See #51800.
git-svn-id: https://develop.svn.wordpress.org/trunk@49928 602fd350-edb4-49c9-b593-d223f7449a82
Previously, only the active theme was made available. This commit allows for all themes to be queried if the user has the `switch_themes` or `manage_network_themes` capabilities.
This commit also no longer exposes the `page`, `per_page`, `search` and `context` query parameters since they are not supported by this controller.
Props spacedmonkey, lpawlik, TimothyBlynJacobs.
Fixes#50152.
git-svn-id: https://develop.svn.wordpress.org/trunk@49925 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP notice if the post type is no longer registered.
Follow-up to [14595], [35480].
Props bobbingwide, hareesh-pillai.
Fixes#40309.
git-svn-id: https://develop.svn.wordpress.org/trunk@49924 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the entire list of `WP_Query` args are filterable in the posts controller.
Props Krstarica, TimothyBlynJacobs.
Fixes#42762.
git-svn-id: https://develop.svn.wordpress.org/trunk@49923 602fd350-edb4-49c9-b593-d223f7449a82
Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the `PHP_AUTH_USER` field.
Props MadtownLems, johnbillion, richard.tape, engahmeds3ed.
Fixes#52003.
git-svn-id: https://develop.svn.wordpress.org/trunk@49919 602fd350-edb4-49c9-b593-d223f7449a82
Previously `null` was returned because the server was accessing the incorrect variable.
Props atimmer, technosailor.
Fixes#52106.
git-svn-id: https://develop.svn.wordpress.org/trunk@49918 602fd350-edb4-49c9-b593-d223f7449a82
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.
See #47577.
git-svn-id: https://develop.svn.wordpress.org/trunk@49909 602fd350-edb4-49c9-b593-d223f7449a82
This brings the accessibility improvements previously made for other areas of the admin in WordPress 5.3 to the installation screens too.
Follow-up to [46241-46244], [46247], [46248], [46293], [46425].
Props Maigret, audrasjb.
Fixes#51854.
git-svn-id: https://develop.svn.wordpress.org/trunk@49907 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the `$term_ids` array in `wp_queue_posts_for_term_meta_lazyload()` (an indexed array not keyed by ID) does not contain duplicate values.
Props denishua, akabarikalpesh.
Fixes#52144.
git-svn-id: https://develop.svn.wordpress.org/trunk@49905 602fd350-edb4-49c9-b593-d223f7449a82
This changeset modifies the Site Health panel for HTTPS to provide more accurate recommendations based on whether the environment is already set up for HTTPS.
* Introduces `wp_is_using_https()` to check whether the site is configured to use HTTPS (via its Site Address and WordPress Address).
* Introduces `wp_is_https_supported()` to check whether the environment supports HTTPS. This relies on a cron job which periodically checks support using a loopback request.
Props Clorith, flixos90, miinasikk, westonruter.
Fixes#47577.
git-svn-id: https://develop.svn.wordpress.org/trunk@49904 602fd350-edb4-49c9-b593-d223f7449a82
The modified checks of the `read_private_posts` capability could result in unexpected SQL queries when calling `WP_Query` with invalid parameters.
Reverts [49830], [49832] and [49833].
See #48556.
git-svn-id: https://develop.svn.wordpress.org/trunk@49899 602fd350-edb4-49c9-b593-d223f7449a82
This most notably affects the response when XML-RPC is disabled or when the supplied username and password is incorrect.
Props ericmann
Fixes#48213
git-svn-id: https://develop.svn.wordpress.org/trunk@49862 602fd350-edb4-49c9-b593-d223f7449a82
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/25220.
It aligns with the latest changes added by aristath to the Gutenberg project. As part of styles splitting for core blocks, there was a special pattern introduced for how style handles are named. Ideally, we would apply it to all blocks but there might be some backward compatibility considerations so I left the handling for non-core blocks unchanged.
Props aristath.
See #50328.
git-svn-id: https://develop.svn.wordpress.org/trunk@49850 602fd350-edb4-49c9-b593-d223f7449a82
The dynamic portion of the hook name, `$action`, refers to the post action.
Props iandunn, jakub.tyrcha, nacin, wonderboymusic, Mte90, johnbillion
Fixes#16849
git-svn-id: https://develop.svn.wordpress.org/trunk@49845 602fd350-edb4-49c9-b593-d223f7449a82
This brings the behaviour inline with the `<title>` element of the page which always shows the author name.
Props Tkama, subrataemfluence
Fixes#44183
git-svn-id: https://develop.svn.wordpress.org/trunk@49843 602fd350-edb4-49c9-b593-d223f7449a82