343 Commits

Author SHA1 Message Date
Peter Wilson
b1db74a765 REST API/Editor: Support post formats in Query Block & Posts API.
Introduces post format support for both the Query Block with the new parameter `format`. In the `build_query_vars_from_query_block()` function, this is converted to a `post_format` taxonomy query passed to `WP_Query`.

Also introduces the `format` parameter to the REST API's Posts controller to support the feature in the Query block. The parameter type is an enumerated  string accepted the post formats supported by each post type.

Props poena, mukesh27, mamaduka, noisysocks, TimothyBlynJacobs.
Fixes #62014.


git-svn-id: https://develop.svn.wordpress.org/trunk@59115 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-30 01:17:40 +00:00
Felix Arntz
a9d76fab56 REST API: Support exact search in the REST API posts endpoint.
This changeset adds support for a new `search_semantics` enum query parameter that can be passed alongside the `search` string parameter. At this point, it only supports "exact" as possible value, but an enum is used for forward compatibility with potential enhancements like "sentence" search support. If `search_semantics=exact` is passed, it will look for an exact match rather than do a full text search, which for some use-cases is more appropriate and more performant.

Props mehulkaklotar, timothyblynjacobs, jimmyh61, ironprogrammer, johnregan3, mukesh27, costdev.
Fixes #56350.


git-svn-id: https://develop.svn.wordpress.org/trunk@59034 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-17 21:56:18 +00:00
Timothy Jacobs
7b8e4451f4 REST API: Automatically populate targetHints for the Allow header.
The REST API uses the "Allow" header to communicate what methods a user is authorized to perform on a resource. This works great when operating on a single item route, but can break down when needing to determine authorization over a collection of items.

This commit uses the "targetHints" property of JSON Hyper Schema to provide access to the "allow" header for "self" links. This alleviates needing to make a separate network request for each item in a collection.

Props mamaduka, noisysocks, peterwilsoncc, spacedmonkey, swissspidy, timothyblynjacobs, tyxla, youknowriad.
Fixes #61739.


git-svn-id: https://develop.svn.wordpress.org/trunk@59032 602fd350-edb4-49c9-b593-d223f7449a82
2024-09-17 21:50:38 +00:00
Peter Wilson
c1ffe3309a Users: Always use HTTPS URLs for Gravatar links.
Modifies gravatar image URLs to always use the HTTPS version from secure.gravatar.com. 

Gravatar now redirects HTTP image requests to their HTTPS equivalent, resulting in redirects for sites running over an HTTP connection (`is_ssl() === false`). Since the introduction of HTTP/2 the use of sub-domains for different hashes ([1-3].gravatar.com) now represents a performance hinderance rather than improvement.

The scheme passed to `get_avatar_data()` is now ignored for the generation of Gravatar URLs but the setting retained to avoid introducing bugs for sites using either local avatars or third party providers.

Props neoxx, SergeyBiryukov, sippis, peterwilsoncc, mukesh27, costdev, dd32.
Fixes #37454.



git-svn-id: https://develop.svn.wordpress.org/trunk@58822 602fd350-edb4-49c9-b593-d223f7449a82
2024-07-29 01:57:11 +00:00
Jorge Costa
5d41bdae52 REST API: Add template and template_lock to post types endpoint.
Adds template and template_lock property of the post type to post types REST API endpoint.
This change allows us to fix a bug where the template of a page is not respected when creating a new page on the site editor.

Props jorgefilipecosta, oandregal, timothyblynjacobs, mukesh27.
Fixes #61477.

git-svn-id: https://develop.svn.wordpress.org/trunk@58452 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-21 13:04:47 +00:00
André
c4dd762c62 REST API: improve code quality for class_list field fixtures.
Follow-up to [58326], #61360.

Props antonvlasenko, oandregal.
Fixes #61369.


git-svn-id: https://develop.svn.wordpress.org/trunk@58340 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-05 11:53:31 +00:00
Ella
782fb1f1a7 Editor: Add theme.json v3 migrations.
See https://github.com/WordPress/wordpress-develop/pull/6616.
See also the original Gutenberg PRs:
* https://github.com/WordPress/gutenberg/pull/58409
* https://github.com/WordPress/gutenberg/pull/61328
* https://github.com/WordPress/gutenberg/pull/61842
* https://github.com/WordPress/gutenberg/pull/62199
* https://github.com/WordPress/gutenberg/pull/62252

Fixes #61282.

Props ajlende, talldanwp, ramonopoly, ellatrix.



git-svn-id: https://develop.svn.wordpress.org/trunk@58328 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-04 11:53:37 +00:00
Ella
278ec2fb3a REST API: Add post class list field.
See https://github.com/WordPress/gutenberg/pull/60642.
See https://github.com/WordPress/wordpress-develop/pull/6716.

Fixes #61360.

Props antonvlasenko, timothyblynjacobs, ellatrix, oandregal.



git-svn-id: https://develop.svn.wordpress.org/trunk@58326 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-04 10:21:11 +00:00
Timothy Jacobs
8d32224e08 REST API: Add batch support to the Users API.
Developers can now include /wp/v2/users routes when making a batch API request.

Props alexminza, timothyblynjacobs, mukesh27.
Fixes #60895.


git-svn-id: https://develop.svn.wordpress.org/trunk@58283 602fd350-edb4-49c9-b593-d223f7449a82
2024-06-02 20:01:44 +00:00
Greg Ziółkowski
a928272d05 Tests: Update the generated fixture for REST API
Follow-up [58227].
See #61137.




git-svn-id: https://develop.svn.wordpress.org/trunk@58232 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-29 10:48:48 +00:00
Ella
6a8460b033 Options: Add 'label' argument to register_setting.
The 'label' will displayed to users when editing core or custom settings via block editors. It avoids hardcoding Settings labels and improves extensibility.

Backports https://github.com/WordPress/gutenberg/pull/59243.

Props mamaduka, timothyblynjacobs, ellatrix.

Fixes #61023.



git-svn-id: https://develop.svn.wordpress.org/trunk@58230 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-29 08:51:04 +00:00
Pascal Birchler
6fc019aa71 REST API: Refactor global styles endpoints in REST API to register with post type.
Updated the global styles endpoints in the REST API to extend from existing posts and revisions controllers. This reduces duplicated code and inconsistencies. The revisions controller is now a subclass of the `WP_REST_Revisions_Controller`. Related redundant methods were removed and schema generation and collection parameters were adjusted to suit the global styles context. Updated permission checks, constructor, and collection parameters accordingly. This change allows for easy override of these classes using the `register_post_type_args` filter.

This reintroduces [57624] (reverted in [57628]) with improved backward compatibility and further enhancements.

Props ramonopoly, spacedmonkey, mukesh27, swissspidy.
Fixes #60131.

git-svn-id: https://develop.svn.wordpress.org/trunk@58225 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-28 12:38:28 +00:00
Pascal Birchler
113c702798 Build/Test Tools: Update REST API fixtures after [58211].
See #41172.

git-svn-id: https://develop.svn.wordpress.org/trunk@58216 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-27 19:03:49 +00:00
Sergey Biryukov
5dc0cc0910 Editor: Add excerpt support to the wp_block post type.
The purpose is to enable using the excerpt as a description for user-created patterns on the Site Editor Pattern screens.

This commit backports the original PR from Gutenberg repository:
* [[https://github.com/WordPress/gutenberg/pull/60549|#60549: [Data Views] User patterns: Use excerpt as description]]

Reference: [[https://github.com/WordPress/gutenberg/issues/55244|#55244: Patterns: Add descriptions to user-created patterns]].

Follow-up to [44146], [44150], [50835], [56030].

Props poena, ntsekouras, krupalpanchal.
Fixes #61250.

git-svn-id: https://develop.svn.wordpress.org/trunk@58184 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-23 13:39:09 +00:00
Pascal Birchler
f9e5c6fb22 REST API: allow overriding excerpt length.
This can be used by the excerpt block in the editor to change the excerpt length without filtering `excerpt_length` in a conflicting way. This enhancement still needs a corresponding change on the Gutenberg side.

Props swissspidy, antonvlasenko, mukesh27, azaozz, andraganescu, timothyblynjacobs.
Fixes #59043.

git-svn-id: https://develop.svn.wordpress.org/trunk@58065 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-30 09:31:41 +00:00
Pascal Birchler
2f0d2dec4c I18N: Actually add all the files for [58061], not just the test fixtures.
Improve support for using only PHP translation files.

This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely `.l10n.php` translation files and no `.mo.` and `.po` files.

Updates `wp_get_installed_translations()`, which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using `WP_Textdomain_Registry`.

Updates `Language_Pack_Upgrader::check_package()` to allow language packs that only contain PHP translation files. While WordPress.org continues to serve `.mo` and `.po` files, third-party services might want to only use the PHP file format.

See #60554.

git-svn-id: https://develop.svn.wordpress.org/trunk@58062 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-30 08:37:25 +00:00
Pascal Birchler
11bc9c9e8c Docs: Fix various typos and spelling mistakes.
Props swissspidy, jucaduca, sergeybiryukov.
See #60699.

git-svn-id: https://develop.svn.wordpress.org/trunk@57987 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-12 17:45:23 +00:00
David Baumwald
e9ab1c15b1 REST API: Revert the refactor of global styles endpoints in REST API in [57624].
[57624] introduced some E2E test failures which are the result of an incompatibility with the Gutenberg plugin.

Props jorbin, spacedmonkey, swissspidy, hellofromTonya, youknowriad, costdev.
See #60131.


git-svn-id: https://develop.svn.wordpress.org/trunk@57628 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-13 15:10:37 +00:00
Jonny Harris
85576726b9 REST API: Refactor global styles endpoints in REST API to register with post type.
Updated the global styles endpoints in the REST API to extend from existing posts and revisions controllers. This reduces duplicated code and inconsistencies. The revisions controller is now a subclass of the WP_REST_Revisions_Controller. Related redundant methods were removed and schema generation and collection parameters were adjusted to suit the global styles context. Updated permission checks, constructor, and collection parameters accordingly. This change allows for easy override of these classes using the `register_post_type_args` filter. 

Props ramonopoly, spacedmonkey, mukesh27.
Fixes #60131.

git-svn-id: https://develop.svn.wordpress.org/trunk@57624 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-13 14:07:38 +00:00
Pascal Birchler
54d72c5dee REST API: Add featured_media field to attachments endpoint.
Audio and video attachments can have a featured image, also known as a poster image. This functionality is now properly exposed by the `wp/v2/media` endpoint.

Props swissspidy, timothyblynjacobs, wonderboymusic, dlh, spacedmonkey.
Fixes #41692.

git-svn-id: https://develop.svn.wordpress.org/trunk@57603 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-12 22:15:45 +00:00
Riad Benguella
a770c6da8d REST API: Introduce the necessary endpoints for the font library.
This commits add three endpoints to retrieve and manipulate fonts in WordPress.
This commit also means that we now have a fully functional Font Library in the site editor.

Props get_dave, youknowriad, mmaattiiaass, grantmkin, swissspidy, mcsf, jorbin, ocean90.
See #59166.

git-svn-id: https://develop.svn.wordpress.org/trunk@57548 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-07 09:18:38 +00:00
Riad Benguella
c45f527fbd REST API: Add route for single styles revisions.
Adds a route for single global styles revisions: /wp/v2/global-styles/${ parentId }/revisions/${ revisionsId }
This fixes the `getRevision` actions in the core-data package.

Props ramonopoly, get_dave.
Fixes #59810.

git-svn-id: https://develop.svn.wordpress.org/trunk@57494 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-31 10:39:04 +00:00
Tonya Mork
f6905ebced Taxonomy: Set "public" to "false" for user pattern categories.
Changes the `'wp_pattern_category'` taxonomy's `'public'` argument to `false`.

Follow-up to [56642].

Props vrajadas, glendaviesnz, hellofromTonya, ramonopoly.
Fixes #59569.

git-svn-id: https://develop.svn.wordpress.org/trunk@57044 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 14:48:50 +00:00
Jonny Harris
1f51e1f4f6 REST API: Fix issue with Template and Template Part Revision/Autosave REST API controllers.
The Template and Template Part REST API controllers have unique characteristics compared to other post type REST API controllers. They do not rely on integer IDs to reference objects; instead, they use a combination of the theme name and slug of the template, like 'twentytwentyfour//home.' Consequently, when the post types template and template part were introduced in [52062], it led to the registration of REST API endpoints for autosaves and revisions with invalid URL structures.

In this commit, we introduce new functionality to enable custom autosave and revisions endpoints to be registered at the post type level. Similar to the 'rest_controller_class' parameter, developers can now define 'revisions_rest_controller' and 'autosave_rest_controller.' This empowers developers to create custom controllers for these functionalities. Additionally, we introduce a 'late_route_registration' parameter, which proves helpful when dealing with custom URL patterns and regex pattern matching issues.
This commit registers new classes for template and template part autosave and revisions controllers, differentiating them from standard controllers in the following ways:
* The response shape now matches that of the template controller.
* Permission checks align with the template controller.
* A custom URL pattern is introduced to support slug-based identification of templates.

Furthermore, we've updated the utility function '_build_block_template_result_from_post' to support passing revision post objects. This enhancement ensures compatibility with the custom revisions controller.

Props spacedmonkey, revgeorge, andraganescu, hellofromTonya, antonvlasenko, kadamwhite, ironprogrammer, costdev, mukesh27, timothyblynjacobs, adamsilverstein. 
Fixes 56922.

git-svn-id: https://develop.svn.wordpress.org/trunk@56819 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 14:03:03 +00:00
Adam Silverstein
4f56c3d18a Revisions: framework for storing post meta revisions.
Enable the storing of post meta in revisions including autosaves and previews:

Add a new argument `revisions_enabled` to the `register_meta` function which enables storing meta in revisions.

Add a new `wp_post_revision_meta_keys` filter which developers can use to control which meta is revisioned - it passes an array of the meta keys with revisions enabled as well as the post type.

Meta keys with revisions enabled are also stored for autosaves, and are restored when a revision or autosave is restored. In addition, meta values are now stored with the autosave revision used for previews. Changes to meta can now be previewed correctly without overwriting the published meta (see #20299) or passing data as a query variable, as the editor currently does to preview changes to the featured image.

Changes to meta with revisions enabled are considered when determining if a new revision should be created. A new revision is created if the meta value has changed since the last revision.

Revisions are now saved on the `wp_after_insert_post` hook instead of `post_updated`. The `wp_after_insert_post` action is fired after post meta has been saved by the REST API which enables attaching meta to the revision. To ensure backwards compatibility with existing action uses, `wp_save_post_revision_on_insert` function exits early if plugins have removed the previous `do_action( 'post_updated', 'wp_save_post_revision' )` call.

Props: alexkingorg, johnbillion, markjaquith, WraithKenny, kovshenin, azaozz, tv-productions, p51labs, mattheu, mikeschroder, Mamaduka, ellatrix, timothyblynjacobs, jakemgold, bookwyrm, ryanduff, mintindeed, wonderboymusic, sanchothefat, westonruter, spacedmonkey, hellofromTonya, drewapicture, adamsilverstein, swisspiddy.
Fixes #20564, #20299.




git-svn-id: https://develop.svn.wordpress.org/trunk@56714 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:30:34 +00:00
Isabel Brison
2c2924089d Taxonomy: add taxonomy for user pattern categories.
Adds a `wp_pattern_category` taxonomy linked to the `wp-block` object.

Props glendaviesnz, kebbet, desrosj, mamaduka.
Fixes #59379.


git-svn-id: https://develop.svn.wordpress.org/trunk@56642 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-21 04:23:12 +00:00
Isabel Brison
1d7554d1b2 Editor: load title on navigation fallback.
Adds raw title property when loading the navigation fallback with an embed context.

Props ramonopoly, get_dave, scruffian, mukesh27, audrasjb.
Fixes #58557.



git-svn-id: https://develop.svn.wordpress.org/trunk@56296 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-25 06:28:28 +00:00
Isabel Brison
c345180c29 REST API: add revisions endpoint for global styles.
Adds an endpoint that returns revisions to the global styles custom post.

Props ramonopoly, peterwilsoncc, spacedmonkey, mukesh27, timothyblynjacobs.
Fixes #58524.


git-svn-id: https://develop.svn.wordpress.org/trunk@56082 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 03:33:23 +00:00
Isabel Brison
3d551af3f2 Editor: add navigation fallback.
Creates a fallback menu for the Navigation block including an API endpoint to retrieve it.

Props get_dave, spacedmonkey, kebbet, flixos90, mikeschroder, ramonopoly, audrasjb.
Fixes 58557.


git-svn-id: https://develop.svn.wordpress.org/trunk@56052 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 05:52:06 +00:00
Isabel Brison
b524268be4 Editor: rename reusable blocks to patterns.
Renames the Reusable blocks to Patterns and adds an option to convert a block or collection of blocks to a non-synced Pattern.

Props glendaviesnz, ramonopoly, peterwilsoncc, timothyblynjacobs, flixos90.
Fixes #58577.


git-svn-id: https://develop.svn.wordpress.org/trunk@56030 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-26 08:55:31 +00:00
Daniel Bachhuber
b46b855070 REST API: Support non-Latin characters in template route regex.
Non-Latin characters are URL-encoded (e.g. `%cf%84%ce%b5%cf%83%cf%84`). Matching `%` in the route ensures templates with non-Latin titles can be properly saved.

Props antonyagrios, mburridge.
Fixes #57329.


git-svn-id: https://develop.svn.wordpress.org/trunk@55294 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-07 23:45:18 +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
Tonya Mork
119ec3240e Editor: Adds pagination and ordering support to WP_REST_Pattern_Directory_Controller.
Adds pagination and ordering support to `WP_REST_Pattern_Directory_Controller` by allow listing `'per_page'`, `'page'`, `'offset'`, `'order'`, and `'orderby'` query parameters. This change enables pagination and ordering features in the pattern directory explorer by using the same sort as wordpress.org/patterns.

Reference:
* [https://github.com/WordPress/gutenberg/pull/45293 Gutenberg PR 45293]

Follow-up to [55098], [51206], [51021].

Props ntsekouras, ryelle, arrasel403, hellofromTonya, ironprogrammer, mukesh27, robinwpdeveloper.
Fixes #57501.

git-svn-id: https://develop.svn.wordpress.org/trunk@55132 602fd350-edb4-49c9-b593-d223f7449a82
2023-01-24 16:52:42 +00:00
David Baumwald
d7750e4924 Editor: Remove leading whitespace from some translated strings.
Merges [https://github.com/WordPress/gutenberg/pull/44314 Gutenberg PR #44314] into trunk.

Follow-up to [54263] and [54269].

Props kebbet, bernhard-reiter.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54356 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-29 17:52:39 +00:00
Jorge Costa
34ace2304b Editor: Add has_archive property to the post types REST endpoint.
Backports PHP changes in WordPress/gutenberg#42746 to the core. Adds a has_archive field to the post types endpoint.

Props mcsf, ntsekouras, oandregal.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54273 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-21 12:27:33 +00:00
Tonya Mork
b3436039f2 Editor: Adds template types, is_wp_suggestion, and fallback template content.
This commit improves site editor templates by:

* Adds a post meta `is_wp_suggestion` to templates created from the site editor.

Why? To differentiate the templates created from the post editor in the Template panel in inspector controls and the templates suggested in site editor.

See [https://github.com/WordPress/gutenberg/pull/41387 Gutenberg PR 41387] for more details.

* Expands the template types that can be added to the site editor to include single custom post type and specific posts templates.

See [https://github.com/WordPress/gutenberg/pull/41189 Gutenberg PR 41189] for more details.

* Adds fallback template content on creation in site editor:
   * Introduces `get_template_hierarchy()` to get the template hierarchy for a given template slug to be created.
   * Adds a `lookup` route to `WP_REST_Templates_Controller` to get the fallback template content.

See [https://github.com/WordPress/gutenberg/pull/42520 Gutenberg PR 42520] for more details.

* Fixes a typo in default category template's description within `get_default_block_template_types()`.

See [https://github.com/WordPress/gutenberg/pull/42586 Gutenberg PR 42586] for more details.

* Changes field checks from `in_array()` to `rest_is_field_included()` in `WP_REST_Post_Types_Controller`.
* Adds an `icon` field to `WP_REST_Post_Types_Controller`

Follow-up to [53129], [52331], [52275], [52062], [51962], [43087].

Props ntsekouras, spacedmonkey, mamaduka, mburridge, jameskoster, bernhard-reiter, mcsf, hellofromTonya.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54269 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-20 21:19:10 +00:00
Joe Dolson
4c173550a2 Media: Change alt attribute field to textarea in media library.
Change the input field used for `alt` attributes in the media library views from a text input to a textarea. This gives users more flexibility in resizing the field for easier management of longer alt attributes. 

This patch includes a less-common use of `esc_attr` for a `textarea`. This is because the primary usage of the `alt` attribute will be escaped using `esc_attr`, and the value in editing should match the value output on the front end.

Props edent, sabernhardt, afercia, JavierCasares, audrasjb, joedolson.
Fixes #50066.

git-svn-id: https://develop.svn.wordpress.org/trunk@54243 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-20 04:00:35 +00:00
Timothy Jacobs
a400e99225 REST API: Add support for searching resources by id.
This brings support for the `include` and `exclude` collection parameters to the Search Controller. This can be used to find an item by id when it's subtype is unknown.

Props kadamwhite.
Fixes #56546.


git-svn-id: https://develop.svn.wordpress.org/trunk@54123 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-11 21:10:31 +00:00
Sergey Biryukov
18e1e81dea REST API: Add the missing site_icon_url to the index.
The `site_icon_url` index was supposed to ship with WordPress 5.6, but was [https://github.com/WordPress/gutenberg/pull/22952 never backported to core].

This commit backports the original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/42957 #42957: REST API: Add the missing 'site_icon_url' to the index]

Follow-up to [52080].

Props Mamaduka, bernhard-reiter, TimothyBlynJacobs.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54083 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-06 14:41:08 +00:00
Felix Arntz
6ff5bf856a Site Health: Introduce page cache check.
This changeset adds a new `page_cache` check which determines whether the site uses a full page cache, and in addition assesses the server response time. If no page cache is present and the server response time is slow, the check will suggest use of a page cache.

A few filters are included for customization of the check:
* `site_status_good_response_time_threshold` filters the number of milliseconds below which the server response time is considered good. The default value is based on the `server-response-time` Lighthouse audit and can be altered using this filter.
* `site_status_page_cache_supported_cache_headers` filters the map of supported cache headers and their callback to determine whether it was a cache hit. The default list includes commonly used cache headers, and it is filterable to support e.g. additional cache headers used by specific vendors.

Note that due to the nature of this check it is only run in production environments.

Props furi3r, westonruter, spacedmonkey, swissspidy, Clorith.
Fixes #56041.


git-svn-id: https://develop.svn.wordpress.org/trunk@54043 602fd350-edb4-49c9-b593-d223f7449a82
2022-08-31 22:44:04 +00:00
Jb Audras
66dba67484 Administration: Change default site tagline to an empty string.
This changeset replaces the default "Just another WordPress site" tagline with an empty string for new installations. The reasoning is:

1. Not all themes display the tagline;
2. Not everyone changes the default tagline;
3. When people don't see the tagline in their theme, they may not realize it is still visible in some places, like feeds.

The string "Just another WordPress site" and the related multisite string: "Just another {NETWORK} site" are now only used as a placeholder for the tagline admin option.

Props markjaquith, Denis-de-Bernardy, westi, RyanMurphy, kovshenin, SergeyBiryukov, chriscct7, tyxla, hyperbrand, karmatosed, lukecavanagh, melchoyce, boemedia, khag7, sabernhardt, audrasjb, peterwilsoncc, costdev, martinkrcho, rafiahmedd.
Fixes #6479.


git-svn-id: https://develop.svn.wordpress.org/trunk@53815 602fd350-edb4-49c9-b593-d223f7449a82
2022-08-03 12:18:22 +00:00
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
Tonya Mork
dc3204ec1d REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter.
[53218] introduced a bug of a wrong response from the `wp/v2/pattern-directory/patterns` endpoint with a `slug` parameter. As the response is cached, it can result in an incorrect list of available patterns supported by the current theme.

This commit resolves by:

* Limiting the `slug` to an `array` in the query parameters.
* When set, parsing and sorting the slug(s) and then serializing the sorted query args as part of the hashed transient keys.

Props antonvlasenko, timothyblynjacobs, spacedmonkey, costdev, hellofromTonya.

Follow-up to [53218], [53152], [51208].
Fixes #55617.

git-svn-id: https://develop.svn.wordpress.org/trunk@53333 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:58:48 +00:00
Greg Ziółkowski
a807e86391 REST API: Bring new endpoints for Block Patterns from Gutenberg plugin
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.




git-svn-id: https://develop.svn.wordpress.org/trunk@53152 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-12 09:24:51 +00:00
Jb Audras
d6703bbb33 Administration: Replace "can not" with "cannot" after [53131].
Follow-up to [53132], [53131], [52979].


git-svn-id: https://develop.svn.wordpress.org/trunk@53136 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-11 12:06:15 +00:00
Jb Audras
60e372dd2e Administration: Remove self-reference ("we") in WordPress Admin.
This changes updates many strings to remove self-references to an undefined "we" collective across the WordPress Administration.

The goal of this change is to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word "we" should be avoided (…) unless its made very clear which group is speaking.

Props johnbillion, shital-patel, audrasjb, marybaum, SergeyBiryukov, peterwilsoncc, johnjamesjacoby, kebbet, costdev, chaion07, davidbaumwald.
Fixes #46057.


git-svn-id: https://develop.svn.wordpress.org/trunk@53131 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-11 11:40:38 +00:00
Riad Benguella
ed1f411c56 Block Editor: Backport the Global Styles Variations endpoint.
This include the /global-styles/themes/{theme}/variations rest endpoint into core.
The endpoint will be used by the site editor to display alternative theme styles to the user.

Props gziolo, oandregal.
See #55505.


git-svn-id: https://develop.svn.wordpress.org/trunk@53072 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-05 09:50:13 +00:00
Jb Audras
6c270d0d17 Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.


git-svn-id: https://develop.svn.wordpress.org/trunk@52978 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-22 16:23:32 +00:00
Jb Audras
482936752a Tests: Update qUnit test fixtures after [52535].
See #54745.


git-svn-id: https://develop.svn.wordpress.org/trunk@52536 602fd350-edb4-49c9-b593-d223f7449a82
2022-01-06 23:23:23 +00:00