44844 Commits

Author SHA1 Message Date
Adam Silverstein
2e911f4f16 Media: Add "webp" extension to wp.media.controller.Library isImageAttachment.
Add "webp" extension to a media extension check, fixing an issue where the last used media
link type was not used for WebP images.

Props almendron, desrosj, kallookoo.
Fixes #53917.



git-svn-id: https://develop.svn.wordpress.org/trunk@52073 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 14:59:44 +00:00
Dominik Schilling
04cd9e2db2 Editor, Docs: Add documentation for the $block_editor_context parameter of the block_editor_rest_api_preload_paths hook.
See #52920.
See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52072 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 12:58:08 +00:00
Riad Benguella
dd9bca79bb Site Editor: Load as full screen by default.
To avoid UI jumps when loading the page, the site-editor.php page
is marked as full screen by default. 
This also matches the behavior of the post editor.

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52071 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 09:12:38 +00:00
Timothy Jacobs
cd2a9d78f2 REST API: Regenerate wp-api-generated.js after [52068].
See #53063.


git-svn-id: https://develop.svn.wordpress.org/trunk@52070 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 02:26:19 +00:00
Robert Anderson
f034bc832e Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.


git-svn-id: https://develop.svn.wordpress.org/trunk@52069 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 02:15:23 +00:00
Timothy Jacobs
ecf1d6a158 REST API: Add batch support for posts and terms controllers.
This also exposes the value of `allow_batch` in `OPTIONS` requests to a route.

A future commit will add batch support to more resources.

Props spacedmonkey, chrisvanpatten.
See #53063.


git-svn-id: https://develop.svn.wordpress.org/trunk@52068 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 01:57:48 +00:00
Tonya Mork
29615a6c70 Posts, Post Types: Add $old_status parameter to {$new_status}_{$post->post_type} action.
Follow-up to [5797], [28106], [31461].

Props aaroncampbell, audrasjb, desrosj, johnbillion, sebastianpisula, swissspidy.
Fixes #36180.

git-svn-id: https://develop.svn.wordpress.org/trunk@52067 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 01:29:58 +00:00
Tonya Mork
6f023bc765 General: Convert wp_list_filter() into a wrapper for wp_filter_object_list().
The code in `wp_list_filter()` was a duplicate of `wp_filter_object_list()`, minus the `WP_List_Util::pluck()` (used when `$field` is configured).

In testing the wrapper, discovered an edge case (and potential bug) in `WP_List_Util::filter()` where if the operator matches an empty array was returned without resetting the output property. Without that property being set correctly, `WP_List_Util::get_output()` was not correct. This commit also fixes this by resetting the property to an empty array.  

Follow-up to [15686], [17427], [38928], [51044].

Props pbearne, sergeybiryukov, hellofromTonya.
Fixes #53988.

git-svn-id: https://develop.svn.wordpress.org/trunk@52066 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 01:09:11 +00:00
Felix Arntz
8649d6d4ff Media: Refine the heuristics to exclude certain images and iframes from being lazy-loaded to improve performance.
This changeset implements the refined lazy-loading behavior outlined in https://make.wordpress.org/core/2021/07/15/refining-wordpress-cores-lazy-loading-implementation/ in order to improve the Largest Contentful Paint metric, which can see a regression from images or iframes above the fold being lazy-loaded. Adjusting this so far has been possible for developers via filters and still is, however this enhancement brings a more accurate behavior out of the box for the majority of themes.

Specifically, this changeset skips the very first "content image or iframe" on the page from being lazy-loaded. "Content image or iframe" denotes any image or iframe that is found within content of any post in the current main query loop as well as any featured image of such a post. This applies both to "singular" as well as "archive" content: On a "singular" page the first image/iframe of the post is not lazy-loaded, while on an "archive" page the first image/iframe of the _first_ post in the query is not lazy-loaded.

This approach refines the lazy-loading behavior correctly for the majority of themes, which use a single-column layout for post content. For themes with multi-column layouts, a new `wp_omit_loading_attr_threshold` filter can be used to change how many of the first images/iframes are being skipped from lazy-loaded (default is `1`). For example, a theme using a three-column grid of latest posts for archives could use the filter to override the threshold to `3` on archive pages, so that the first three content images/iframes would not be lazy-loaded.

Props adamsilverstein, azaozz, flixos90, hellofromtonya, jonoaldersonwp, mte90, rviscomi, tweetythierry, westonruter.
Fixes #53675. See #50425.


git-svn-id: https://develop.svn.wordpress.org/trunk@52065 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 00:34:17 +00:00
Tonya Mork
fab9d0685e Users: Introduce wp_list_users() function.
Introduces a new function called `wp_list_users()`. Similar to other list functions such as `wp_list_authors()`, it lists all the users of the site. Options are available to configure the HTML output.

Following the same pattern of the other list functions, the list's HTML output is rendered by default. Setting the `echo` argument to `false`, returns the list's HTML output.

A new test class is included.

Props afercia, audrasjb, chriscct7, costdev, desrosj, greenshady, hellofromTonya, mte90, nacin, rohan013, sergeybiryukov.
Fixes #15145.

git-svn-id: https://develop.svn.wordpress.org/trunk@52064 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 00:22:34 +00:00
Joe Dolson
9558873885 Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52060].

See #43700.

git-svn-id: https://develop.svn.wordpress.org/trunk@52063 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 23:18:35 +00:00
Robert Anderson
39e33bed83 Editor: Add block theme infrastructure
Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.


git-svn-id: https://develop.svn.wordpress.org/trunk@52062 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 23:09:53 +00:00
Tonya Mork
81b29a2865 General: Add "noopener" to wp_list_bookmarks() output.
In the bookmarks walker `_walk_bookmarks()`, add a `'noopener'` to the bookmark's `rel` attribute when there's `target` attribute.

Adds a new test class for `wp_list_bookmarks()` and tests for this change.

Follow-up to [3880], [10712].

Props birgire, costdev, hellofromTonya, mukesh27 , sergeybiryukov, tw2113.
Fixes #53839.

git-svn-id: https://develop.svn.wordpress.org/trunk@52061 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 23:05:50 +00:00
Joe Dolson
4a77621488 Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52058].

See #43700.

git-svn-id: https://develop.svn.wordpress.org/trunk@52060 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 23:02:40 +00:00
Anthony Burchell
56ff78042c Media: Change upload button to a file input for better e2e targeting.
Changes the media library upload button to `input type="file"` for better end to end testing capabilities.

Props  justinahinon, joedolson, sabernhardt, audrasjb.
Fixes #54168.



git-svn-id: https://develop.svn.wordpress.org/trunk@52059 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 22:47:09 +00:00
Joe Dolson
99514de6bb I18N: Add language switcher on login/registration screens.
Load a language switcher on the login and registration screens that allows users to choose any already-installed language. Set user locale on registration.

Props johnbillion, Nikschavan, afercia, sabernhardt, garrett-eclipse, keyur5, paaljoachim, Clorith, tobifjellner.
Fixes #43700.

git-svn-id: https://develop.svn.wordpress.org/trunk@52058 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 22:36:11 +00:00
Jorge Costa
0f0735a888 Add: get_query_pagination_arrow function to core.
Fixes a crash that is happening when using an FSE theme because a function required is missing. Ports the function from the Gutenberg plugin.

Props oandregal, youknowriad.

git-svn-id: https://develop.svn.wordpress.org/trunk@52057 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 22:30:41 +00:00
Jorge Costa
3c482788b9 Fix: Linting error affecting trunk.
Props oandregal.

git-svn-id: https://develop.svn.wordpress.org/trunk@52056 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 21:56:17 +00:00
John James Jacoby
3e4677b94b Admin/Help: add commas to end of multi-line array items.
Follow up to r52053.

See #54357.

git-svn-id: https://develop.svn.wordpress.org/trunk@52055 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 21:53:50 +00:00
Jorge Costa
8e30713cd5 Add: Public functions for interacting with global styles & settings.
This commit ports the public functions to interact with the global styles & settings.

See #54336.
Props oandregal.

git-svn-id: https://develop.svn.wordpress.org/trunk@52054 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 21:44:12 +00:00
John James Jacoby
a2015573eb Admin/Help: add docs links to several screens.
This change intends to better guide users towards many of the useful resources available on WordPress.org.

* Appearance/Customizer - Add link to Customizer docs.
* Appearance/Editor - Improve link text & destination.
* Privacy Settings - Link to Privacy Settings docs.
* Site Health - Link to Site Health docs.

Props audrasjb, jdy68, webcommsat.

Fixes #54357.

git-svn-id: https://develop.svn.wordpress.org/trunk@52053 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 21:41:43 +00:00
Jorge Costa
872b818794 Add: Global styles user content escaping.
This commit adds global styles user content escaping. In addition, it ports the logic on the Gutenberg plugin implemented on WordPress/gutenberg#28061 to the core.
The logic tries to follow what was done for standard post content.

See #54336.
Props oandregal.

git-svn-id: https://develop.svn.wordpress.org/trunk@52052 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 21:23:34 +00:00
Jorge Costa
5ca3347268 Add: Global Styles Rest endpoints.
This commit ports the global styles rest endpoints from the Gutenberg plugin into the core.

See #54336.
Props oandregal, aristath, timothyblynjacobs, spacedmonkey, youknowriad.

git-svn-id: https://develop.svn.wordpress.org/trunk@52051 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 20:58:56 +00:00
Jorge Costa
247159da45 Fix: Update block-theme-pl_PL.mo file.
See #54336.
Props oandregal.

git-svn-id: https://develop.svn.wordpress.org/trunk@52050 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 20:32:39 +00:00
Jorge Costa
60725c46ca Update theme.json classes for WordPress 5.9.
This commit ports to core the changes to the classes that deal with theme.json code.

See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.

git-svn-id: https://develop.svn.wordpress.org/trunk@52049 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 19:18:39 +00:00
Sergey Biryukov
31e9247872 Tests: Remove the formatting group from wp_is_numeric_array() tests.
Similar to `wp_array_slice_assoc()` or other array-related functions, this appears to be a general-purpose function unrelated to the Formatting component.

Add missing `public` visibility keyword.

Follow-up to [52037].

See #53971.

git-svn-id: https://develop.svn.wordpress.org/trunk@52048 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 17:07:49 +00:00
Jonathan Desrosiers
7e04f4dd82 Build/Test Tools: Update/Audit NPM dependencies for bundled themes.
This updates several NPM dependencies to their latest (or latest allowed) versions for bundled themes that have a `package.json` file (Twenty Nineteen and newer).

These updates did not result in any changes to the built files in Twenty Nineteen or Twenty Twenty. Some unnecessary parenthesis have been removed from `calc()` function calls within Twenty Twenty-One.

This change also contains several updates to the `package-lock.json` files made by running `npm audit fix` within each of these themes.

See #53361.

git-svn-id: https://develop.svn.wordpress.org/trunk@52047 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 16:24:38 +00:00
Jonathan Desrosiers
81f3e49b3f Build/Test Tools: Update/Audit NPM dependencies for 5.9.
This updates several NPM dependencies to their latest (or latest allowed) versions.

- `autoprefixer` from `9.8.6` to `9.8.8`
- `chalk` from `4.1.1` to `4.1.2`
- `grunt-contrib-concat` from `1.0.1` to `2.0.0`
- `grunt-contrib-jshint` from `3.0.0` to `3.1.1`
- `grunt-contrib-qunit` from `4.0.0` to `5.1.1`
- `qunit` from `2.16.0` to `2.17.2`
- `sass` from `1.34.1` to `1.43.4`
- `sinon` from `11.1.1` to `12.0.1`
- `sinon-test` from `3.1.0` to `3.1.1`
- `uglify-js` from `3.13.9` to `3.14.3`
- `wait-on` from `5.3.0` to `6.0.0`

This change also contains several updates to the `package-lock.json` file made by running `npm audit fix`.

See #53361.

git-svn-id: https://develop.svn.wordpress.org/trunk@52046 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 16:13:32 +00:00
Tonya Mork
588f155406 Posts/Post Types: Improves the 'is_post_type_viewable' filter boolean return.
As a follow-up to [52024], simplifies the strict boolean type check to conserve memory and processing. Also includes an explanation of why a strict boolean is required as the returned filtered value. This commit is consistent with the implementation in [52043].

Follow-up to [33666], [36402], [52024].

Props hellofromTonya, peterwilsoncc, cybr, jrf.
Fixes #49628.


git-svn-id: https://develop.svn.wordpress.org/trunk@52045 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 15:33:10 +00:00
Jonathan Desrosiers
874c62cde2 Themes: Remove temporary Full Site Editing safety checks.
These checks were added in [51193] and [51197] as a temporary measure to prevent a site owner from activating a Full Site Editing theme when Gutenberg plugin was not active.

Because Core only had partial support for the features required for FSE, the front end of the site would display a white screen or error message to visitors. Unless the site owner visited the front end, there would be no indication that there was a problem.

Since 5.9 will include the remaining features required for FSE, these checks can be removed.

Props poena, jffng.
Fixes #54366. See #534190.

git-svn-id: https://develop.svn.wordpress.org/trunk@52044 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 15:26:32 +00:00
Tonya Mork
18004914f3 Posts/Post Types: Introduce 'is_post_status_viewable ' filter in is_post_status_viewable().
Introduces a new filter 'is_post_status_viewable' which allows overriding the check.

The function's return signature is a boolean type. This commit ensures
the return signature remains unchanged by requirinng a strict boolean
type of the returned filtered value.

Why?
* To maintain this signature and backwards-compatibility.
* To future prepare for PHP 8.1 and beyond.

An explanation is included in the filter's DocBlock.

Follow-up to [50130].

Props audrasjb, hellofromTonya, peterwilsoncc.
Fixes #54375.

git-svn-id: https://develop.svn.wordpress.org/trunk@52043 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 15:20:51 +00:00
Riad Benguella
fdb2dacc19 Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52042 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 14:26:27 +00:00
jorgefilipecosta
7bbee20833 Add: wp_global_styles custom post type.
This commit adds the wp_global_styles custom post type following the same approach used to add other core custom post types. It also updates the wp_theme taxonomy to include the wp_global_styles post type.
The post type is registered in the same way it is on the plugin we just adapt the location for the core.

See #54336.
Props oandregal.

git-svn-id: https://develop.svn.wordpress.org/trunk@52041 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 14:24:02 +00:00
Tonya Mork
1046682e4f General: Introduce polyfills for str_ends_with() and str_starts_with() added in PHP 8.0.
PHP 8.0 introduced two new functions: `str_ends_with()` and `str_starts_with()`. These perform a case-sensitive check indicating if the string to search in (haystack) ends or begins with the given substring (needle).

These polyfills make these functios available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions
* PHP manual `str_ends_with()` https://www.php.net/manual/en/function.str-ends-with.php
* PHP manual `str_starts_with()`  https://www.php.net/manual/en/function.str-starts-with.php

Props costdev, hellofromTonya, pbearne, pbiron.
Fixes #54377.

git-svn-id: https://develop.svn.wordpress.org/trunk@52040 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 14:21:44 +00:00
Tonya Mork
3cc8f1237a General: Introduce polyfill for str_contains() added in PHP 8.0.
PHP 8.0 introduced a new function: `str_contains()`. It performs a case-sensitive check indicating if given substring (needle) is contained in the string to search in (haystack).

This polyfill makes this function available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/str_contains
* PHP manual https://www.php.net/manual/en/function.str-contains.php

Props ayeshrajans, costdev, desrosj, hellofromTonya, knutsp, pbearne.
Fixes #49652.

git-svn-id: https://develop.svn.wordpress.org/trunk@52039 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 14:02:54 +00:00
Tonya Mork
b21d748b41 General: Introduce polyfills for array_key_first() and array_key_last() added in PHP 7.3.0.
PHP 7.3.0 introduced two new functions: `array_key_first()` and `array_key_last()`. These two functions return the first and last key of each array respectively, without affecting the internal state of the array.

The polyfills make these two functions available for use in Core on PHP versions less than 7.3.0.

Ref:
* PHP RFC https://wiki.php.net/rfc/array_key_first_last
* PHP manual `array_key_first()` https://www.php.net/manual/en/function.array-key-first.php
* PHP manual `array_key_last()` https://www.php.net/manual/en/function.array-key-last.php

Props desrosj, pbearne, costdev, hellofromTonya, ayeshrajans, manzoorwanijk, audrasjb, sergeybiryukov.
Fixes #45055.

git-svn-id: https://develop.svn.wordpress.org/trunk@52038 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 13:50:35 +00:00
Tonya Mork
2648a5f984 General: Add phpunit tests for wp_is_numeric_array().
Adds new test class `Tests_Functions_WpIsNumericArray` for `wp_is_numeric_array()`.

Props pbearne, hareesh-pillai, hellofromTonya.
Fixes #53971.

git-svn-id: https://develop.svn.wordpress.org/trunk@52037 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 13:29:25 +00:00
Greg Ziółkowski
105584a5f7 Fix relative URLs in inlined block styles that involve external assets
When styles got inlined, relative URLs break. The problem was that URLs inside CSS files are relative to the stylesheet's path, and when styles get inlined that relation is lost. This patch fixes the issue by finding relative URLs which then get modified to be relative to the site's root.

Fixes #54243.
Props aristath, cdyerkes, hellofromtonya.



git-svn-id: https://develop.svn.wordpress.org/trunk@52036 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 13:23:44 +00:00
John Blackbourn
d088e31c73 Docs: Various docblock improvements and corrections.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52035 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 10:47:55 +00:00
John Blackbourn
a247caa0af Docs: Fix some docblock syntax errors and add a missing canonical reference.
See #53399, #52867, #38942, #53668


git-svn-id: https://develop.svn.wordpress.org/trunk@52034 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 10:43:52 +00:00
Anthony Burchell
9c00ed2069 Media: Adjust alt text info link text.
Previous messaging of this link was confusing given it went to an external source. This change describes more accurately that it will perform the action of taking you to the resource.

Props karmatosed, joedolson, melchoyce, hellofromTonya, afercia, sabernhardt, antpb.
Fixes #48939.



git-svn-id: https://develop.svn.wordpress.org/trunk@52033 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-08 00:21:50 +00:00
Anthony Burchell
8ac6425f19 Media: Remove security messaging in media upload failures.
Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.



git-svn-id: https://develop.svn.wordpress.org/trunk@52032 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 23:28:48 +00:00
Joe Dolson
2ce222c92b Widgets: Add filter to disable RSS widget icon.
Add a filter that disables output of the icon on RSS feed widgets. Improves accessibility by providing a path to prevent duplicate or invisible links.

Props sabernhardt, Boniu91.
Fixes #52224.

git-svn-id: https://develop.svn.wordpress.org/trunk@52031 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 23:03:47 +00:00
Joe Dolson
4f2ce0716c Editor: Update structure of title element for editing.
Re-format the title element for post editing to follow general scheme for WordPress admin screens.

Props SergeyBiryukov.
Fixes #52314.

git-svn-id: https://develop.svn.wordpress.org/trunk@52030 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 22:08:55 +00:00
Joe Dolson
99705b35b8 Comments: Mark comment text field as required.
Add required asterisk to the comment text field. Historically, the name and email fields are marked as required, but the comment text field is not, though it is actually a required field.

Props infected, solarissmoke, rianrietveld, afercia, sabernhardt, strider72, mai21, audrasjb.
Fixes #16206.

git-svn-id: https://develop.svn.wordpress.org/trunk@52029 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 21:13:11 +00:00
Anthony Burchell
cdb15e353a Media: Add filter for post thumbnail id.
Introduces new filter `post_thumbnail_id` which allows overriding the default id returned from `get_post_thumbnail_id()`.

Props engelen, alexvorn2, gilbitron, sebastianpisula, SergeyBiryukov, leogermani, rzen, joemcgill, audrasjb.
Fixes #23983.



git-svn-id: https://develop.svn.wordpress.org/trunk@52028 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 20:36:11 +00:00
Anthony Burchell
ff0425a81f Media: Add filter for post thumbnail url.
Introduces new filter `post_thumbnail_url` which allows overriding the default url returned from `wp_get_attachement_image_url()`.

Props ibenic, SergeyBiryukov, jackreichert, audrasjb.
Fixes #40547.



git-svn-id: https://develop.svn.wordpress.org/trunk@52027 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 19:27:45 +00:00
Sergey Biryukov
b7bbb52298 Coding Standards: Move wp-includes/class-http.php to wp-includes/class-wp-http.php.
This renames the file containing the `WP_Http` class to conform to the coding standards.

This commit also includes:

- A new `class-http.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

Follow-up to [8516], [13274], [33748].

Fixes #54389. See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52026 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-07 01:35:52 +00:00
Sergey Biryukov
6523e724ee Coding Standards: Rename the $strResponse argument to $str_response in WP_Http::processResponse().
This fixes a `Variable "$strResponse" is not in valid snake_case format` WPCS warning.

Additionally, rename a `$res` variable to `$response` for clarity.

Follow-up to [8516], [51823], [51826], [51877].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52025 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-06 21:55:50 +00:00
Tonya Mork
9c72fd73cb Posts/Post Types: Add filter to is_post_type_viewable().
Introduces a new filter `'is_post_type_viewable'` which allows overriding the check. The expected filtered value is a boolean. As filtered values can change, including the data type, this commit includes a `is_bool()` check, thus ensuring backwards-compatibility.

Follow-up to [33666], [36402].

Props audrasjb, deepaklalwani, hellofromTonya, peterwilsoncc, powerbuoy, sergeybiryukov.
Fixes #49628.

git-svn-id: https://develop.svn.wordpress.org/trunk@52024 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-05 23:00:44 +00:00