47468 Commits

Author SHA1 Message Date
Jb Audras
face5a97dd Build/Test Tools: Add unit tests for wp_set_password hook.
Follow-up to [55056].

Props audrasjb, SergeyBiryukov, costdev.
Fixes #57436.


git-svn-id: https://develop.svn.wordpress.org/trunk@55250 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 09:24:00 +00:00
Jb Audras
e146f22ddf Media: Maintain the functionnality of the deprecated WP_Media_List_Table::column_desc() method.
Follow-up to [55159].

Props peterwilsoncc, costdev, mukesh27.
Fixes #39710.


git-svn-id: https://develop.svn.wordpress.org/trunk@55249 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 09:06:51 +00:00
Jb Audras
4b6d7ebbc5 Query: Add a search_columns argument to control which fields are searched in a search query.
Previously, the `s` argument of the `WP_Query::parse_query()` method searched the `post_title`, `post_excerpt`, and `post_content` fields, with no way of controlling this apart from using the `posts_search` filter and adjusting the SQL manually. This changeset adds the ability to specify which fields are searched when performing a query, using the `search_columns` argument.

Props johnbillion, birgire, petitphp, audrasjb, costdev, mukesh27.
Fixes #43867.


git-svn-id: https://develop.svn.wordpress.org/trunk@55248 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 08:53:01 +00:00
Riad Benguella
0d0812c52d Site Editor: Backport site editor intialization changes from Gutenberg 15.1
The site editor has been updated to not require the "home template" setting. 
This removes the key from the settings passed to the frontend.

Props flixos90, hellofromtonya, ntsekouras.
Fixes #57480.


git-svn-id: https://develop.svn.wordpress.org/trunk@55247 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 07:14:11 +00:00
Riad Benguella
07fc9b2d74 Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes.
In addition to all the packages being updated to the latest versions, 
this commit also includes some mandatory changes to avoid editor breakage:

 - Update React to to 18.2.0.
 - Add the right stylesheets to support iframed block editors.

Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.


git-svn-id: https://develop.svn.wordpress.org/trunk@55246 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 07:01:56 +00:00
Peter Wilson
d46dc08342 Formatting: Guard wp_strip_all_tags() against fatal errors.
Check the input of `wp_strip_all_tags()` before passing it to `strip_tags()`. This protects against fatal errors introduced in PHP 8, retaining the `E_USER_WARNING` from PHP 7, and prevents a PHP 8.1 deprecation notice when passing null.

Props chocofc1, costdev, jrf, dd32, audrasjb, peterwilsoncc.
Fixes #56434.



git-svn-id: https://develop.svn.wordpress.org/trunk@55245 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 03:32:43 +00:00
Peter Wilson
9d8e1ae068 Filesystem API: Add test for uncovered WP_Error in move_dir().
Introduces a test for the `WP_Error` object `destination_not_deleted_move_dir` in the `move_dir()` function.

Follow up to [55226].

Props costdev, mukesh27.
Fixes #57375.



git-svn-id: https://develop.svn.wordpress.org/trunk@55244 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 03:15:49 +00:00
Peter Wilson
0708727a88 Embeds: Use documented mixcloud.com oembed endpoint.
Adds a trailing slash to the mixcloud.com oembed endpoint to match the documented version.

Follow up to [55068].

Props jeherve, matclayton.
Fixes #57376.



git-svn-id: https://develop.svn.wordpress.org/trunk@55243 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 03:08:26 +00:00
Peter Wilson
a697d6c373 Embeds: Update YouTube provider for live URLs.
YouTube Live stream URLs can take the form of `youtube.com/live/videocode`. This registers the URL format for the oembed provider.

Props slieschke, costdev.
Fixes #57632.



git-svn-id: https://develop.svn.wordpress.org/trunk@55242 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 02:54:06 +00:00
Felix Arntz
e88660bc38 Emoji: Fix emoji feature detection.
The emoji feature detection that occurs on every page load by default has been broken at least since [45769], causing the feature detection to fail for browsers that in fact support emoji correctly. This has led to the `wp-emoji-release.min.js` file being loaded unnecessarily even in modern browsers, which accounts for roughly 4.7 KB of extra JavaScript on every page load.

This changeset fixes the feature detection, by using the correct sequences of char codes.

Props sergiomdgomes, dmsnell, peterwilsoncc.
Fixes #57301.


git-svn-id: https://develop.svn.wordpress.org/trunk@55241 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 21:35:25 +00:00
Jb Audras
d69b60e7ca Coding Standards: Add missing escaping function in Custom_Image_Header::show_header_selector().
Props chintan1896, SergeyBiryukov.
Fixes #57638.


git-svn-id: https://develop.svn.wordpress.org/trunk@55240 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 21:34:56 +00:00
Jb Audras
9f772e8805 Users: Update get_avatar_url() and get_avatar() to include RoboHash support.
Follow-up to [55238].

Fixes #57493.


git-svn-id: https://develop.svn.wordpress.org/trunk@55239 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 21:28:15 +00:00
Jb Audras
83909d1660 Users: Add support for RoboHash Gravatar images in default user profile pics.
Gravatar includes support for RoboHash auto-generated images. This changeset adds it to the built-in feature for user profile images.

See Gravatar docs: https://en.gravatar.com/site/implement/images/.

Props juliobox, audrasjb.
Fixes #57493.


git-svn-id: https://develop.svn.wordpress.org/trunk@55238 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 21:17:14 +00:00
Jb Audras
f78f1ba8e0 External Libraries: Update jQuery Migrate to version 3.4.0.
A full list of changes in this release can be found upstream on the jQuery Migrate GitHub repository:
https://github.com/jquery/jquery-migrate/compare/3.3.2...3.4.0.

Props desrosj, audrasjb, a4jpcom, stalukder03, mukesh27, adeltahri, robinwpdeveloper, mahbubshovan.
Fixes #56743.


git-svn-id: https://develop.svn.wordpress.org/trunk@55237 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 20:57:05 +00:00
Felix Arntz
84a59fe5f7 Themes: Add caching to WP_Theme::is_block_theme().
This changeset adds a `block_theme` entry in the theme cache data, similar to the existing entries `headers`, `errors`, `stylesheet`, and `template`.

Props spacedmonkey, costdev, joemcgill, flixos90, mukesh27, adamsilverstein.
Fixes #57114.


git-svn-id: https://develop.svn.wordpress.org/trunk@55236 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 19:57:41 +00:00
Felix Arntz
195393fdbb Editor: Use WP_HTML_Tag_Processor in wp_render_elements_support().
Props ntsekouras.
Fixes #57642.


git-svn-id: https://develop.svn.wordpress.org/trunk@55235 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 19:41:25 +00:00
Felix Arntz
363ed92463 Editor: Support the block_types and viewport_width props for remote patterns fetched from Pattern Directory.
Props ntsekouras, ironprogrammer, hellofromtonya, flixos90.
Fixes #57611.


git-svn-id: https://develop.svn.wordpress.org/trunk@55234 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 19:38:08 +00:00
Jonathan Desrosiers
a5ee8d64c6 Build/Test Tools: Update npm dependencies for bundled themes.
This applies several dependency version updates to Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One.

`npm audit fix` has also been run to automatically fix any packages with reported vulnerabilities.

See #57535.

git-svn-id: https://develop.svn.wordpress.org/trunk@55233 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 18:53:27 +00:00
Jonathan Desrosiers
153d7c758d Build/Test Tools: Update json2php package.
This updates the `json2php` package to the latest version, which is currently `0.0.7`.

See #57535.

git-svn-id: https://develop.svn.wordpress.org/trunk@55232 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 18:42:33 +00:00
Jorge Costa
97a0b1e7f3 Block editor: Update WP_Theme_JSON_Resolver and improve its performance.
This commit includes the latest updates WP_Theme_JSON_Resolver class made in the block editor. Some of these updates improve the performance of the class.

Props Mamaduka, hellofromTonya, flixos90, jorgefilipecosta, oandregal, spacedmonkey, audrasjb, costdev, scruffian.
Closes #57545.

git-svn-id: https://develop.svn.wordpress.org/trunk@55231 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 15:31:50 +00:00
Jorge Costa
38f74685cd Block editor: Add ID support to block wrapper attributes.
This commit adds support for the ID attribute for dynamically rendered blocks.

Props Soean, flixos90, poena, costdev, Mamaduka.
Closes #56852.

git-svn-id: https://develop.svn.wordpress.org/trunk@55230 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 15:22:38 +00:00
SergeyBiryukov
4122c031d2 Upgrade/Install: Send language pack updates to copy_dir().
If the `clear_working` flag in `WP_Upgrader::install_package()` is false, the source should not be removed, so `copy_dir()` should be used instead.

Partial updates, like language packs, may want to retain the destination. If the destination exists or has contents, this may be a partial update, and the destination should not be removed, so `copy_dir()` should be used instead.

Follow-up to [55204], [55219], [55220], [55223], [55226].

Props afragen, costdev, swissspidy.
See #57557.

git-svn-id: https://develop.svn.wordpress.org/trunk@55229 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 14:46:01 +00:00
Jb Audras
21887884e5 Twenty Fourteen: Correctly reflect text color changes in Pullquote block.
This changeset ensures text color changes on Pullquote block are reflected on both front-end and in the editor.

Props umesh84, audrasjb, sabernhardt, bgoewert, ruchirj, amitbarai013, robinwpdeveloper, shamayel007.
Fixes #56006.


git-svn-id: https://develop.svn.wordpress.org/trunk@55228 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 08:57:13 +00:00
Jb Audras
1a028ccf8d Twenty Sixteen: Fix Gallery block images alignement.
This changeset fixes an alignment issue that has been present since the gallery block markup was changed in WordPress 6.0.

Props silicium23, zoonini, sabernhardt, bgoewert, ira2910, tahminar27.
Fixes #56412.


git-svn-id: https://develop.svn.wordpress.org/trunk@55227 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 08:24:59 +00:00
Peter Wilson
3524ab9092 Filesystem API: Prevent fatal error in move_dir().
Correctly instantiate `WP_Error()` within `move_dir()` to prevent a fatal error when unable to delete an existing directory that is intended to be replaced.

Follow-up to [55204], [55219], [55220], [55223].

Props swissspidy, costdev, afragen.
Fixes #57375.



git-svn-id: https://develop.svn.wordpress.org/trunk@55226 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-06 04:19:37 +00:00
Sergey Biryukov
ec83fd83fb Upgrade/Install: Silence Requests deprecations before preloading.
Intentional preloading of Requests 2.x classes and interfaces using their old (Requests 1.x) names should not produce deprecation notices.

This commit defines `REQUESTS_SILENCE_PSR0_DEPRECATIONS` as `true` in `_preload_old_requests_classes_and_interfaces()`.

Follow-up to [54997], [55007], [55046].

Props costdev, afragen, jrf.
Fixes #54504.

git-svn-id: https://develop.svn.wordpress.org/trunk@55225 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-05 00:18:35 +00:00
Pascal Birchler
81f31d6fd8 I18N: Improve method names in WP_Locale_Switcher().
This is a follow-up to [55161] to rename `::get_current_locale()` to `::get_switched_locale()` and `::get_current_user_id()` to `::get_switched_user_id()` for improved clarity.

Also:

* Fix docblock for `switch_locale` filter. The User ID is `false` if missing, not `null`.
* Add additional test involving `restore_previous_locale()` and improve test cleanup.

And most importantly: happy birthday ocean90! 🎂

Props johnjamesjacoby, ocean90.
See #57123.

git-svn-id: https://develop.svn.wordpress.org/trunk@55224 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 20:45:36 +00:00
Sergey Biryukov
c4cba6d49c Filesystem API: Simplify two conditionals in move_dir().
This updates the check whether the destination directory already exists to only call `$wp_filesystem->exists()` once.

Follow-up to [55204], [55219], [55220].

Props azaozz, afragen, SergeyBiryukov.
Fixes #57375.

git-svn-id: https://develop.svn.wordpress.org/trunk@55223 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 15:35:29 +00:00
Sergey Biryukov
1226afc5a4 Docs: Use consistent format for the @return tags in _wp_object_name_sort_cb() and _wp_object_count_sort_cb().
Both functions are used as a callback for `uasort()`.

Follow-up to [36013], [55214].

See #57358, #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55222 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 15:16:13 +00:00
Jb Audras
d90afeeb69 Media: Properly escape Download row action link in Media List Table.
Props joedolson, pbiron, audrasjb.
Fixes #57574.


git-svn-id: https://develop.svn.wordpress.org/trunk@55221 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 07:08:22 +00:00
Andrew Ozz
ca76a8d907 Upgrade/Install: Use move_dir() instead of copy_dir() in WP_Upgrader::install_package() when possible. This would make the filesystem operations a lot faster in most cases, and potentially reduce failures.
Props: afragen, costdev, peterwilsoncc, pbiron, mukesh27, SergeyBiryukov, azaozz.
Fixes: #57557.

git-svn-id: https://develop.svn.wordpress.org/trunk@55220 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 03:29:43 +00:00
Andrew Ozz
d8e7eef76d Filesystem API: Update move_dir() to better handle the differences in the WP_Filesystem::move() methods.
Changes `move_dir()` to attempt to delete the destination when overwriting, before calling `WP_Filesystem::move()`.

Props: afragen, costdev, azaozz.
Fixes: #57375.

git-svn-id: https://develop.svn.wordpress.org/trunk@55219 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-04 01:06:57 +00:00
Joe Dolson
73ebc7660c Media: Hide 'view' link if empty string passed to attachment_link.
Fix empty href attribute on 'View' link when the `attachment_link` filter is used to hide attachment pages.

Props oh_hello, iqbalrony.
Fixes #54824.

git-svn-id: https://develop.svn.wordpress.org/trunk@55218 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 22:23:19 +00:00
Joe Dolson
56fdee27eb Media: Pass $size argument to get_attached_file filter.
Pass the new `$size` argument on `get_attached_file()` to `get_attached_file` filter. Follow up to [55199].
 
Props SergeyBiryukov, joedolson.
Fixes #51780.

git-svn-id: https://develop.svn.wordpress.org/trunk@55217 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 19:23:40 +00:00
Felix Arntz
8900fdfd76 Editor: Add missing WP_Theme_JSON::process_blocks_custom_css() method.
Follow up to [55192].

Props aristath, mamaduka, mukesh27, hellofromtonya.
Fixes #57621.


git-svn-id: https://develop.svn.wordpress.org/trunk@55216 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 18:23:55 +00:00
Jonny Harris
97aeca6f73 Query: Revert [55169].
Revert [55169] and mark #56689 as wontfix. `get_page_by_path` can not use `WP_Query`, as is results in fatel errors for those using `get_page_by_path` in the `pre_get_posts` action or `posts_pre_query` filter. This sadly means that `WP_Query` can never be used in `get_page_by_path`.

Props spacedmonkey, iandunn, mukesh27, joemcgill, adamsilverstein, otto42. 
See #56689.

git-svn-id: https://develop.svn.wordpress.org/trunk@55215 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 16:15:55 +00:00
Jb Audras
b7db42f94e Fix a PHP 8 deprecation warning in category-template.php uasort() helper.
Props Webrocker, jigar-bhanushali, jrf, audrasjb, costdev.
Fixes #57358.
See #56790.


git-svn-id: https://develop.svn.wordpress.org/trunk@55214 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 15:42:11 +00:00
Sergey Biryukov
bd4d4af784 Docs: Capitalize X-Pingback in discover_pingback_server_uri() DocBlock.
Follow-up to [55210], [55211], [55212].

See #54225.

git-svn-id: https://develop.svn.wordpress.org/trunk@55213 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 14:45:42 +00:00
Sergey Biryukov
e83ea74dce HTTP API: Restore one instance of the X-Pingback header capitalization.
The revert in the previous commit appears to be accidental.

Follow-up to [55210], [55211].

See #54225.

git-svn-id: https://develop.svn.wordpress.org/trunk@55212 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 14:39:31 +00:00
Jb Audras
5c840d93bb HTTP API: Fix a unit test failure found after [55210].
Follow-up to [55210].

See #54225.


git-svn-id: https://develop.svn.wordpress.org/trunk@55211 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 13:51:11 +00:00
Jb Audras
8fbe21a37a HTTP API: Fix request header inconsistencies.
This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.

Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes #54225.


git-svn-id: https://develop.svn.wordpress.org/trunk@55210 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 13:33:18 +00:00
Jb Audras
4b71b1565a Media: Replace consecutive periods in sanitize_file_name().
On some servers, consecutive periods in a filename can cause a 403 Forbidden response.
This changeset replaces consecutive periods with a single period, and adds related unit tests.

Props ArtZ91, costdev, SergeyBiryukov, arthurshlain, mukesh27.
Fixes #57242.


git-svn-id: https://develop.svn.wordpress.org/trunk@55209 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 12:46:18 +00:00
Peter Wilson
4833e2c06f Posts, Post Types: Add test coverage for _truncate_post_slug().
Props xknown, mukesh27, costdev, audrasjb.
Fixes #56868.
See #56793.


git-svn-id: https://develop.svn.wordpress.org/trunk@55208 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 04:03:00 +00:00
Peter Wilson
0138b0dcd6 Posts, Post Types: Deprecate get_page_by_title() in favour of WP_Query.
Formally deprecate `get_page_by_title()`. In its current form the function is unpredictable in that it may return a result that leads to a 404 error and will return different results depending on the database version/engine combination used.

It is recommended developers use `WP_Query` instead:

{{{
$query = new WP_Query(
 array(
  'post_type' => 'page',
  'title'     => 'Sample Page',
 )
);
}}}


Props TimothyBlynJacobs, costdev, mukesh27, spacedmonkey, peterwilsoncc.
Fixes #57041.


git-svn-id: https://develop.svn.wordpress.org/trunk@55207 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 03:56:10 +00:00
Andrew Ozz
f0cbb9dde4 Fix couple of typos in inline docs.
Props: ironprogrammer.
See #57575.

git-svn-id: https://develop.svn.wordpress.org/trunk@55206 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 02:12:36 +00:00
Andrew Ozz
b85f581714 Docs: Document directory support in FTP/SSH2 filesystem ::move() methods.
Props: costdev, flixos90, audrasjb.
Fixes: #57604.

git-svn-id: https://develop.svn.wordpress.org/trunk@55205 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 01:57:31 +00:00
Andrew Ozz
5872edc052 Filesystem API: Add directory support to WP_Filesystem_Direct::move().
Introduces:
- New function: `wp_opcache_invalidate_directory()`, to recursively call `wp_opcache_invalidate()` after overwriting .php files.
- New function: `move_dir()`, similar to `copy_dir()` that uses `WP_Filesystem::move()` followed by `wp_opcache_invalidate_directory()`, and has a fallback to `copy_dir()`.

Props: costdev, afragen, peterwilsoncc, sergeybiryukov, ironprogrammer, flixos90, bronsonquick, mukesh27, azaozz.
Fixes #57375.

git-svn-id: https://develop.svn.wordpress.org/trunk@55204 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 01:48:36 +00:00
Andrew Ozz
39bfc2580d Introduce HTML API with HTML Tag Processor
This commit pulls in the HTML Tag Processor from the Gutenbeg repository.

The Tag Processor attempts to be an HTML5-spec-compliant parser that provides the ability in PHP to find specific HTML tags and then add, remove, or update attributes on that tag. It provides a safe and reliable way to modify the attribute on HTML tags.

More information: https://github.com/WordPress/wordpress-develop/pull/3920.

Props: antonvlasenko, bernhard-reiter, costdev, dmsnell, felixarntz, gziolo, hellofromtonya, zieladam, flixos90, ntsekouras, peterwilsoncc, swissspidy, andrewserong, onemaggie, get_dave, aristath, scruffian, justlevine, andraganescu, noisysocks, dlh, soean, cbirdsong, revgeorge, azaozz.
Fixes #57575.

git-svn-id: https://develop.svn.wordpress.org/trunk@55203 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 01:03:59 +00:00
Sergey Biryukov
05b08caac8 Docs: Improve the DocBlock for get_attached_file().
Includes:
* Using 3-digit format for the `@since` tag.
* Minor wording updates and formatting corrections.

Follow-up to [3203], [4612], [6379], [8203], [24983], [29090], [55199].

See #51780, #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55202 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 00:45:24 +00:00
Tonya Mork
67c8bf8e0d Editor: Add missing controls to flex layouts in wp_get_layout_style().
Adds missing controls to flex layouts in `wp_get_layout_style()` for justify-content and vertical alignment options.

References:
* [https://github.com/WordPress/gutenberg/pull/47134 Gutenberg PR 47134].

Follow-up to [54274].

Props isabel_brison, andrewserong, jameskoster, joen, onemaggie , ndiego.
Fixes #57602.

git-svn-id: https://develop.svn.wordpress.org/trunk@55201 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 00:34:59 +00:00