* Rename the `wp_approved_environment_types` filter to `wp_environment_types`.
* Introduce `WP_ENVIRONMENT_TYPES` system variable and constant to complement the filter.
* Correct the argument type for the `wp_environment_types` filter.
* Cache the result in a static variable to ensure consistent return value.
* Rename the `stage` type to `staging`.
Follow-up to [47919].
Props dlh, dd32, TimothyBlynJacobs, johnbillion, pbiron.
See #33161.
git-svn-id: https://develop.svn.wordpress.org/trunk@48188 602fd350-edb4-49c9-b593-d223f7449a82
Due to an unintended `break` instruction from a previous iteration, the function cached only one term in each taxonomy.
Follow-up to [48055].
Props Chouby.
Fixes#50352.
git-svn-id: https://develop.svn.wordpress.org/trunk@48187 602fd350-edb4-49c9-b593-d223f7449a82
The filter is the callback function added with `add_filter()`, therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.
The documentation is referring to the latter.
Props johnbillion.
See #49572, #16557.
git-svn-id: https://develop.svn.wordpress.org/trunk@48185 602fd350-edb4-49c9-b593-d223f7449a82
This improves the wording of the inline documentation for `redirect_guess_404_permalink()` and the related filters introduced in [47878].
Previously [47878,47885]
See #16557.
git-svn-id: https://develop.svn.wordpress.org/trunk@48182 602fd350-edb4-49c9-b593-d223f7449a82
Adds a Social Icons Filter to Twenty Twenty that allows for new icons to be added to the theme by filter.
Props JarretC, nielslange, acosmin, desrosj.
Fixes#48713.
git-svn-id: https://develop.svn.wordpress.org/trunk@48180 602fd350-edb4-49c9-b593-d223f7449a82
This endpoint allows a user to retrieve the block type definition for all server-side registered block types.
Props spacedmonkey, aduth, gziolo, ocean90, TimothyBlynJacobs.
Fixes#47620.
git-svn-id: https://develop.svn.wordpress.org/trunk@48173 602fd350-edb4-49c9-b593-d223f7449a82
This adds some extra details to the message:
* The current PHP or WordPress version.
* The plugin's minimum required PHP or WordPress version.
* A link to the support documentation on how to update PHP.
Props stuffradio, johnbillion, garrett-eclipse, sabernhardt, williampatton, SergeyBiryukov.
Fixes#48245.
git-svn-id: https://develop.svn.wordpress.org/trunk@48172 602fd350-edb4-49c9-b593-d223f7449a82
Currently themes can declare support for a given feature by using add_theme_support(). This commit adds a register_theme_feature() API that allows plugins and WordPress Core to declare a list of available features that themes can support.
The REST API uses this to expose a theme's supported features if the feature has been registered with "show_in_rest" set to true.
Props kadamwhite, spacedmonkey, williampatton, desrosj, TimothyBlynJacobs.
Fixes#49406.
git-svn-id: https://develop.svn.wordpress.org/trunk@48171 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ensures that attachment images which are inserted without `width` and `height` attributes still receive them in the frontend, to reduce cumulative layout shift. Adding the dimensions happens as part of the logic for adding `srcset` and `sizes` attributes, which already assume the specific width and height of the respective image.
Images are now only lazy-loaded if they have `width` and `height` attributes present. While missing these attributes itself is what causes layout shifts, lazy-loading such images can make this problem more apparent to the user.
Props adamsilverstein, westonruter.
Fixes#50367. See #44427.
git-svn-id: https://develop.svn.wordpress.org/trunk@48170 602fd350-edb4-49c9-b593-d223f7449a82
This was deprecated in [20212] in favor of passing `”uploads” => true` to the `custom-header` feature, so it should not be specified as an available feature in the parameter documentation.
See #49572.
git-svn-id: https://develop.svn.wordpress.org/trunk@48169 602fd350-edb4-49c9-b593-d223f7449a82
When files are copied into place, check whether opcode invalidation is available and attempt to invalidate to avoid unintended behavior or fatal errors from themes, plugins, or core.
Introduces `wp_opcache_invalidate()` to allow safe invalidation of PHP files from opcode cache, and a filter, `wp_opcache_invalidate_file` to override the behavior.
Replaces the existing calls to `opcache_invalidate()` in the plugin and theme editors to use the new function.
Thanks to jnylen0 for porting over a patch from ClassicPress that provided much of the approach for what is being committed.
Props nigro.simone, dd32, JasWSInc, szepe.viktor, swissspidy, JanR, asalce, Garavani, pavelevap, pputzer, GregLone, benoitchantre, jadonn, doc987, kraftbj, Krstarica, jnylen0, nextendweb, williampatton, ayeshrajans, joostdevalk, stevenkussmaul, boogah, jorbin, mikeschroder.
Fixes#36455, #50354.
git-svn-id: https://develop.svn.wordpress.org/trunk@48160 602fd350-edb4-49c9-b593-d223f7449a82
The `wp_update_comment_data` filter introduced in 4.7 allows comment data to be filtered before it is updated in the database.
The patch aims to handle `WP_Error` as the filter above return value in a similar manner as is done for `wp_new_comment()`.
Fixes#39732.
Props: enricosorcinelli, swissspidy, gkloveweb, jnylen0, jbpaul17, afercia, SergeyBiryukov, audrasjb, imath, davidbaumwald.
git-svn-id: https://develop.svn.wordpress.org/trunk@48154 602fd350-edb4-49c9-b593-d223f7449a82
This makes the API a little more clear, whereas setting `false` used to mean `asc` and `true` meant `desc`, you can now use those directly, while maintaining back-compat.
Fixes#45089.
Props Tkama, SergeyBiryukov, shital-patel, desrosj, birgire, davidbaumwald.
git-svn-id: https://develop.svn.wordpress.org/trunk@48151 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the link still makes sense when read out of context by assistive technologies.
Additionally, underline the link per the accessibility coding standards.
Props samful, afercia, williampatton, audrasjb.
Fixes#50338.
git-svn-id: https://develop.svn.wordpress.org/trunk@48146 602fd350-edb4-49c9-b593-d223f7449a82
Per WCAG 2.0 guidelines, big chunks of italic text should be avoided for better accessibility.
Additionally, replace the legacy `.error` class for "You deactivated this plugin and may no longer need this policy" message with `.notice-info`.
Follow-up to [47147], [48116].
Props afercia, audrasjb.
See #47327, #44621.
git-svn-id: https://develop.svn.wordpress.org/trunk@48145 602fd350-edb4-49c9-b593-d223f7449a82