Commit Graph

20371 Commits

Author SHA1 Message Date
Sergey Biryukov
f1b3ce0902 REST API: Use the integer type for page_on_front and page_for_posts options.
This adjusts the newly added options in the settings endpoint to use the `integer` type instead of `number`. Since these are page IDs and are not supposed to be floats, `integer` is the correct type.

Follow-up to [53588].

See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53589 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 14:15:57 +00:00
Sergey Biryukov
a0b53ac1db REST API: Add missing options to the settings endpoint.
This adds the `show_on_front`, `page_on_front`, and `page_for_posts` options to the settings endpoint that were missed during WP 6.0 backports.

Related PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/38607 #38607 Page for Posts: Display notice in template panel]

Props Mamaduka, spacedmonkey, gziolo, jameskoster.
See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53588 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 13:46:37 +00:00
Jb Audras
aaa4d1a4a7 Help/About: Typo correction in the Media Library help tab text.
Follow-up to [53586].

Props SergeyBiryukov.
Fixes #55800.


git-svn-id: https://develop.svn.wordpress.org/trunk@53587 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 13:37:38 +00:00
Jb Audras
0abc2b2a5b Help/About: Add help tab info for available row actions in the Media Library.
This changeset fills the existing help tab with more detailed information about available row actions in the Media Library, when using the List view.

Props kebbet, audrasjb, costdev, SergeyBiryukov, mukesh27.
Fixes #55800.


git-svn-id: https://develop.svn.wordpress.org/trunk@53586 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 20:45:28 +00:00
Jb Audras
44871d68a2 Docs: Misc fixes in Shortcode API function and hook descriptions, as per documentation standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53585 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 20:35:45 +00:00
Sergey Biryukov
911cc55368 Docs: Adjust some DocBlocks in wpdb per the documentation standards.
Includes:
* Wrapping long single-line comments to multi-line for better readability.
* Formatting code blocks to display correctly on the Code Reference.
* Other minor edits for consistency.

This applies to:
* `wpdb::$allow_unsafe_unquoted_parameters`
* `wpdb::escape_identifier()`
* `wpdb::_escape_identifier_value()`
* `wpdb::prepare()`
* `wpdb::has_cap()`

Follow-up to [53575].

See #52506, #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53584 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 11:25:21 +00:00
Sergey Biryukov
b03466a79d General: Revert an earlier define of the WPINC constant in src/index.php.
This avoids a `Constant WPINC already defined in src/wp-settings.php on line 16` PHP warning, which happens when running a WordPress install out of the `src` directory after `npm run build:dev`.

Add a comment to clarify the check for built assets and the direct mention of `wp-includes`.

Follow-up to [53518].

Props aristath.
See #54233.

git-svn-id: https://develop.svn.wordpress.org/trunk@53579 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-27 10:18:44 +00:00
Sergey Biryukov
b6aabe46b7 Upgrade/Install: Add a conditional to facilitate testing of the Rollbacks feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.

If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.

This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.

Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
Fixes #56057. See #51857, #54166.

git-svn-id: https://develop.svn.wordpress.org/trunk@53578 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-26 12:35:28 +00:00
David Baumwald
2fa1194a75 Comments: Add contextual autocomplete attributes to comment form fields.
For accessibility, input fields should identify their "purpose".  The HTML5 attribute `autocomplete` allows for various user data to be quickly autofilled while adding context for some assistive technologies.

This commit adds the appropriate autofill purposes for an author's name, email, and website URL in the comment form template.

Props juliemoynat, bhrugesh96, sabernhardt.
Fixes #55779.

git-svn-id: https://develop.svn.wordpress.org/trunk@53576 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 21:24:18 +00:00
David Baumwald
ac64f38b66 Database: Add %i placeholder support to $wpdb->prepare to escape table and column names.
WordPress does not currently provide an explicit method for escaping SQL table and column names. This leads to potential security vulnerabilities, and makes reviewing code for security unnecessarily difficult.  Also, static analysis tools also flag the queries as having unescaped SQL input.

Tables and column names in queries are usually in-the-raw, since using the existing `%s` will straight quote the value, making the query invalid.

This change introduces a new `%i` placeholder in `$wpdb->prepare` to properly quote table and column names using backticks.

Props tellyworth, iandunn, craigfrancis, peterwilsoncc, johnbillion, apokalyptik.
Fixes #52506.

git-svn-id: https://develop.svn.wordpress.org/trunk@53575 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 20:33:56 +00:00
Sergey Biryukov
c5db33f82e Media: Use correct escaping function for URLs in some legacy media functions.
This affects:
* `get_image_send_to_editor()`
* `image_link_input_fields()`

Follow-up to [7092], [7874], [8653], [11109], [11204], [11383], [12051], [12199], [19982].

Props smit08, mukesh27.
Fixes #56064.

git-svn-id: https://develop.svn.wordpress.org/trunk@53570 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 13:50:53 +00:00
Sergey Biryukov
ed2bf69b0f Editor: Add utility classnames back to blocks that have layout attributes specified.
[https://github.com/WordPress/gutenberg/issues/38719 In 5.9 these utility classnames were removed], which removed the ability for theme/plugin authors to assign their own custom CSS related to specific layout selections. This was mostly related to the Button block.

This commit adds these classes dynamically based on attributes, rather than saving them to the serialized content.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/41487 #41487 Add utility classnames back to blocks that have layout attributes specified]

Props glendaviesnz, peterwilsoncc, andrewserong, zieladam, matveb, samikeijonen.
See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53568 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 23:07:11 +00:00
Jb Audras
10cfe4945c Application Passwords: Ensure long passwords don't break the "new password" notice.
This changeset adds a `word-wrap: break-word` CSS declaration to avoid text overflow in the "new application password" notice.

Props Presskopp, hasanuzzamanshamim, yannielsen, audrasjb.
Fixes #54581.


git-svn-id: https://develop.svn.wordpress.org/trunk@53567 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 23:02:19 +00:00
Jb Audras
b9c137ceab Docs: Use third-person singular verbs for function descriptions in Bookmark related files, as per docblock standards.
This changeset updates `bookmark.php` and `bookmark-template.php` files.

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53566 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 22:55:41 +00:00
John Blackbourn
32ee6cb39e Themes: Add actions to template loading to assist with collecting debug info.
This introduces the following new actions which wrap the process of loading a template file:

* `wp_before_load_template`
* `wp_after_load_template`

Props rmccue, tabrisrp, peterwilsoncc

Fixes #54541


git-svn-id: https://develop.svn.wordpress.org/trunk@53560 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 18:57:24 +00:00
Aaron Jorbin
828d518988 Editor: Universalize functions for checking block editor status.
`use_block_editor_for_post_type` and `use_block_editor_for_post` can be very useful in more contexts than wp-admin, especially when a site is in transition. For example, you may want to do things on init that are different.

Neither function depends on other functions that are available only in wp-admin (other than use_block_editor_for_post() relying on use_block_editor_for_post_type() and an admin-referrer check that's historically gated by a query variable and now also gated by is_admin), therefore  moving them to wp-includes seems both feasible and beneficial

Props ethitter, jorbin.
Fixes #51819.



git-svn-id: https://develop.svn.wordpress.org/trunk@53559 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 18:46:18 +00:00
Sergey Biryukov
e7cafe6141 Code Modernization: Use the integer portion of an item position in add_submenu_page().
This fixes an `Implicit conversion from float to int loses precision` PHP 8.1 deprecation notice when adding a new admin menu item with a `float` value passed as the `$position` parameter.

This change is covered by existing unit tests and addresses 8 errors when running the test suite on PHP 8.1.

References:
* [https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string PHP 8.1: Implicit incompatible float to int conversion is deprecated]
* [https://wiki.php.net/rfc/implicit-float-int-deprecate PHP RFC: Deprecate implicit non-integer-compatible float to int conversions]

Follow-up to [52569], [53104].

Props jrf.
See #55656, #54798.

git-svn-id: https://develop.svn.wordpress.org/trunk@53555 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-22 14:53:49 +00:00
Jb Audras
af8255775b Docs: Add missing @since mention in get_posts_query_args().
Follow-up to [53548].
See #55633.


git-svn-id: https://develop.svn.wordpress.org/trunk@53551 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:46:29 +00:00
Jonny Harris
dfcfe0b21d Posts, Post Types: Add caching to _find_post_by_old_slug and _find_post_by_old_date functions.
Cache result of database queries in `_find_post_by_old_slug` and `_find_post_by_old_date` functions. This means that repeated requests to a url where the page is not found, will result in hitting a cache for sites running persistent object caching. 

Props Spacedmonkey, dd32, mukesh27, pbearne, flixos90.
Fixes #36723.

git-svn-id: https://develop.svn.wordpress.org/trunk@53549 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:32:48 +00:00
Jb Audras
d91e148452 Sitemaps: Remove duplicate sticky Posts from Sitemap Post Query.
This changeset sets the `ignore_sticky_posts` parameter to `true` in the default arguments passed to `wp_sitemaps_posts_query_args`.

Props RavanH, pbiron, swissspidy, audrasjb, SergeyBiryukov.
Fixes #55633.


git-svn-id: https://develop.svn.wordpress.org/trunk@53548 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:16:10 +00:00
Sergey Biryukov
a14324ca3a Docs: Improve documentation for WP_Image_Editor::save() and related functions.
Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

This affects:
 * `wp_generate_attachment_metadata()`
 * `wp_get_attachment_metadata()`
 * `WP_Image_Editor::save()`
 * `WP_Image_Editor_GD::save()` and `::_save()`
 * `WP_Image_Editor_Imagick::save()` and `::_save()`

Follow-up to [22094], [22619], [52837], [53546].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53547 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 11:16:09 +00:00
Sergey Biryukov
d27deea511 Docs: Correct the return type for wp_save_image_file().
Since WordPress 3.5, `wp_save_image_file()` uses `WP_Image_Editor` classes under the hood to save the images.

While the `save()` method in those instances returns `array|WP_Error` and is documented as such, the return type of the `wp_save_image_file()` function was still left as `bool`.

A better solution would be to adjust the function to return the documented boolean type. However, doing that after 20+ major WP releases would be a backward compatibility break, so the documentation is now updated instead.

Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$image` parameter expecting a `WP_Image_Editor` instance.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

Follow-up to [22094], [22619], [52837].

Props jrf, SergeyBiryukov.
See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53546 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 11:13:17 +00:00
Jonny Harris
40c4f11a81 REST API: Move all links to prepare_links method in theme REST API controller.
Move logic to generate link to global styles to the `prepare_links` method in theme REST API controller. This way all logic to generate links is within the `prepare_links` method, bringing this controller inline with other REST API controllers.

Props SergeyBiryukov, Spacedmonkey.
Fixes #56018.

git-svn-id: https://develop.svn.wordpress.org/trunk@53544 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 10:46:49 +00:00
John Blackbourn
14a468294f I18N: Correct and improve inline docs and tests for functionality related to nooped plurals.
See #55646, #55652


git-svn-id: https://develop.svn.wordpress.org/trunk@53543 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 22:55:52 +00:00
Jb Audras
4e871a9cbd Embeds: Remove Meetup as an oEmbed source since the related endpoint has been deprecated.
This changeset removes Meetup as an oEmbed source, since Meetup.com have deprecated their oEmbed endpoint. The block has already been removed from the editor, see GB#35085.

Props peterwilsoncc, audrasjb, swissspidy.
Fixes #55997.


git-svn-id: https://develop.svn.wordpress.org/trunk@53540 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 21:46:27 +00:00
Jb Audras
dc385a9f47 Docs: Use third-person singular verbs for function descriptions in the Feed API, as per docblock standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53539 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 21:44:27 +00:00
Sergey Biryukov
a649d58128 External Libraries: Upgrade PHPMailer to version 6.6.3.
This is a maintenance release with minor CS improvements.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.6.2...v6.6.3

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500].

Props jrf, Synchro.
Fixes #56016.

git-svn-id: https://develop.svn.wordpress.org/trunk@53535 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 15:02:32 +00:00
Sergey Biryukov
0fa05bacca Docs: Consistently declare the $wp_query global in link template functions.
This ensures that the global is explicitly declared and documented in:
* `get_next_posts_link()`
* `get_posts_nav_link()`
* `get_the_posts_navigation()`
* `get_the_posts_pagination()`
* `get_next_comments_link()`

Follow-up to [30065].

Props mt8.biz, sabernhardt.
Fixes #43164.

git-svn-id: https://develop.svn.wordpress.org/trunk@53520 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-18 15:36:20 +00:00
Sergey Biryukov
8769fbec0d Coding Standards: Fix WPCS issue in [53518].
This fixes an "Concat operator must be surrounded by a single space" error.

See #54233.

git-svn-id: https://develop.svn.wordpress.org/trunk@53519 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-17 11:31:49 +00:00
Sergey Biryukov
d39bc7e304 General: Use WPINC as a shorter reference to wp-includes in some files.
This brings more consistency with similar `require_once` statements and `_deprecated_file()` calls in other files.

Follow-up to [601], [628], [36693], [44359], [45663], [45678], [52026], 

Props malthert.
See #54233.

git-svn-id: https://develop.svn.wordpress.org/trunk@53518 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-17 11:18:37 +00:00
Jb Audras
812af1515f Twenty Twenty-One: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Twenty-One's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props jyolsna, evildon, kajalgohel, audrasjb.
Fixes #55989.


git-svn-id: https://develop.svn.wordpress.org/trunk@53517 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-16 23:41:14 +00:00
Jb Audras
cd46b2b75e Docs: Use third-person singular verbs for function descriptions in the Taxonomy Administration API.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53516 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-16 23:37:29 +00:00
Jb Audras
3db14aa2ed Twenty Nineteen: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Nineteen's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props nithi22, evildon, SergeyBiryukov, audrasjb.
Fixes #55992.


git-svn-id: https://develop.svn.wordpress.org/trunk@53515 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-16 23:15:56 +00:00
Jb Audras
229a578bed Docs: Use third-person singular verbs for function descriptions in the WP_Screen API.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53514 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-16 23:08:25 +00:00
Sergey Biryukov
17554d89aa Docs: Add @since notes for html5 theme feature changes in add_theme_support():
* As of WordPress 3.6.1, the `html5` feature requires an array of types to be passed. Defaults to `comment-list`, `comment-form`, `search-form` for backward compatibility.
* As of WordPress 6.0, the previously added `_doing_it_wrong()` notice is actually displayed as expected.

Follow-up to [25193], [25235], [25785], [49344], [49354], [52828].

Props bobbingwide.
See #51657, #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53513 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-16 15:19:08 +00:00
Sergey Biryukov
ec0f508a9f REST API: Some documentation and test improvements for update_menu_item_cache():
* Make the function description more specific, for consistency with other similar functions.
* Add a `@since` note for the `$update_menu_item_cache` parameter of `WP_Query::parse_query()`.
* Add missing `@covers` tags for the unit tests.

Follow-up to [53504].

See #55620.

git-svn-id: https://develop.svn.wordpress.org/trunk@53508 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-15 13:35:28 +00:00
Sergey Biryukov
20ccbb1437 REST API: Some documentation and test improvements for update_post_parent_caches():
* Make the function description more specific, for consistency with `update_post_author_caches()`.
* Add missing `@covers` tags for the unit test.

Follow-up to [53506].

See #55593.

git-svn-id: https://develop.svn.wordpress.org/trunk@53507 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-15 13:17:59 +00:00
Jonny Harris
9a488568a0 REST API: Prime caches for post parents in post REST API controller.
Prime caches for all post parents in the post REST API controller using the `_prime_post_caches` function. Post parent objects are required as part of the `check_read_permission` method’s permission check in post REST API controller. 

Props spacedmonkey, furi3r, peterwilsoncc, mitogh, madpixels. 
Fixes #55593.

git-svn-id: https://develop.svn.wordpress.org/trunk@53506 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-15 10:41:32 +00:00
Sergey Biryukov
770a909a5f Database: Don't translate the "WordPress database error" message in the error log.
When using multilingual websites, this string could end up with multiple different translations in the error log, making it less actionable.

Unlike errors displayed to the user, a general consensus for software is that errors in logs should always be in English. Since MySQL errors are also returned in English, this brings more consistency to the logs.

Follow-up to [6391], [8168], [19760].

Props malthert.
Fixes #53125.

git-svn-id: https://develop.svn.wordpress.org/trunk@53505 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-15 10:34:07 +00:00
Jonny Harris
aef77be627 REST API: Prime caches for linked objects in menu item REST API controller.
Add a new parameter to `WP_Query` called `update_menu_item_cache` that when set to true, primes the caches for linked terms and posts for menu item post objects. This change moves logic 
found in `wp_get_nav_menu_items` into a new function called `update_menu_item_cache`.  Update the menu item REST API controller, to pass the `update_menu_item_cache` parameter to the 
arguments used for the  `WP_Query` run to get menu items. 

Props furi3r,  TimothyBlynJacobs, spacedmonkey, peterwilsoncc, mitogh.
Fixes #55620.

 --This line, and those below, will be ignored--

M    src/wp-includes/class-wp-query.php
M    src/wp-includes/nav-menu.php
M    src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
M    tests/phpunit/tests/post/nav-menu.php


git-svn-id: https://develop.svn.wordpress.org/trunk@53504 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-15 10:18:02 +00:00
Sergey Biryukov
f3441e37ed Docs: Add a comment for stripping the leading AND from SQL clauses in some query classes.
Follow-up to [30084], [34529], [34542], [36598], [37477], [37572], [43010].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53503 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 16:15:52 +00:00
Sergey Biryukov
18d8db3078 Docs: Add a missing word in pre_months_dropdown_query filter description.
Follow-up to [50163].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53502 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 15:05:18 +00:00
Sergey Biryukov
2d9073413f I18N: Use a translatable string for displaying a user's first name and last name.
That allows locales to switch the order of the first name and last name, should they prefer to do so.

The string was previously used in `wp_insert_user()` and is now reused in other places for consistency:

* `WP_MS_Users_List_Table::column_name()`​
* `WP_Users_List_Table::column_name()​`
* `wp_list_authors()`
* `wp_list_users()`

Note: This also removes the `wp_list_author_full_name` filter, introduced for the same purpose in `wp_list_authors()`, as redundant for now.

Follow-up to [53486].

See #17025.

git-svn-id: https://develop.svn.wordpress.org/trunk@53501 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 14:41:10 +00:00
Jonathan Desrosiers
d60f4f9cab External Libraries: Upgrade PHPMailer to version 6.6.2.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.2.

For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.6.0...v6.6.2.

Props ayeshrajans, jrf.
Fixes #55976.

git-svn-id: https://develop.svn.wordpress.org/trunk@53500 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 14:36:29 +00:00
Jonny Harris
c2de42b9ad REST API: Prime caches for featured images in post controller.
Ensure that featured image caches are primed for post collections in the post REST API controller, by calling the `update_post_thumbnail_cache` function. 

Props Spacedmonkey, TimothyBlynJacobs, mitogh.
Fixes #55592. 



git-svn-id: https://develop.svn.wordpress.org/trunk@53499 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 13:08:39 +00:00
Jonny Harris
219927c11b REST API: Avoid duplicated query in post collections.
Avoid duplicated query when retrieving empty posts collections by adding a check if the page is more than 1. 

Props furi3r, gdetassigny, TimothyBlynJacobs, spacedmonkey. 
Fixes #55677.



git-svn-id: https://develop.svn.wordpress.org/trunk@53498 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 12:40:29 +00:00
Jonny Harris
6d89ea8f09 Taxonomy: Fix caching issues in WP_Term_Query class.
Introduced [52836] when passing `child_of` or `pad_counts` parameters to `get_terms` or `WP_Term_Query` class, the array of terms received by the query, was not correctly cached. This 
change simplifies the logic in `WP_Term_Query` and ensures terms are correctly cached. This change also, improves performance, by only caching an array of term ids where possible.  

Props denishua, spacedmonkey, oztaser, peterwilsoncc, SergeyBiryukov, georgestephanis, jnz31, knutsp, mukesh27, costdev.
Fixes #55837.



git-svn-id: https://develop.svn.wordpress.org/trunk@53496 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-14 11:41:33 +00:00
Sergey Biryukov
793fa4185d Code Modernization: Pass correct default value to setcookie() in wp_user_settings().
The `wp_user_settings()` function calls the PHP native `setcookie()` function, the fifth parameter of which is the ''optional'' `$domain` parameter which expects a `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.

In this case, this function call yielded a `setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

References:
* [https://www.php.net/manual/en/function.setcookie.php PHP Manual: setcookie()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]

Follow-up to [29478].

Props ocean90, shenyanzhi, meysamnorouzi, jrf.
Fixes #54914.

git-svn-id: https://develop.svn.wordpress.org/trunk@53490 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-12 11:09:21 +00:00
Jb Audras
7e0bb191fb Query: Add a hook to filter author full name from wp_list_authors().
This changeset introduces the `wp_list_author_full_name` hook to allows developers to filter author full name, which by default is a combinaison of the author first and last name, separated by a space.

Props kevinB, wonderboymusic, DrewAPicture, nacin, Mte90, jorbin, afercia, rafiahmedd.
Fixes #17025.


git-svn-id: https://develop.svn.wordpress.org/trunk@53486 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-10 18:21:28 +00:00
Jonny Harris
b855e63693 REST API: Improve post cache priming in WP_REST_Post_Search_Handler class.
In the `WP_REST_Post_Search_Handler` class, ensure that post, post meta and term caches are correctly primed when performing a search.

Props furi3r, spacedmonkey, TimothyBlynJacobs, audrasjb, peterwilsoncc. 
Fixes #55674.



git-svn-id: https://develop.svn.wordpress.org/trunk@53485 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-10 15:45:45 +00:00