47236 Commits

Author SHA1 Message Date
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
Tonya Mork
8ff5899348 Widgets: Preserve classic sidebars when switching to a block theme.
When switching to a block theme, classic sidebars were orphaned and their widgets remapping to the `'wp_inactive_widgets'` sidebar . This changeset preserves the sidebars and their widgets, providing a migration path to a block theme without losing the widgets.

Classic sidebars are now:

* Stored in a new theme mod called `'wp_classic_sidebars'`;
* Restored to the `$wp_registered_sidebars` global variable when the `'widgets_init'` action fires (via a new internal function called `_wp_block_theme_register_classic_sidebars()`);
* And marked as `'inactive'` when interacting with sidebars REST API endpoint.

References:
* [https://github.com/WordPress/gutenberg/pull/45509 Gutenberg PR 45509] which adds an option for importing widgets from sidebars into template parts.

Follow-up to [50995], [6334].

Props mamaduka, audrasjb, hellofromTonya, ironprogrammer, jameskoster, joen, matveb, mukesh27, noisysocks, poena, youknowriad.
Fixes #57531.

git-svn-id: https://develop.svn.wordpress.org/trunk@55200 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-03 00:13:52 +00:00
Joe Dolson
a501f4f40d Media: Add argument to get_attached_file() for subsizes.
Add a `$size` argument to `get_attached_file()` to simplify getting the path to an intermediate image size.
 
Props paulschreiber, audrasjb, Mista-Flo.
Fixes #51780.

git-svn-id: https://develop.svn.wordpress.org/trunk@55199 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 23:38:49 +00:00
audrasjb
5b49d955c2 Media: Add a Download row action to the Media List Table.
This changeset makes it easier for users to download their uploaded media by providing a Download row action to the Media List Table. It also rephrases the Copy URL row action for better consistency and to give room for the new Download action.

Follow-up to [55156].

Props pbiron, joedolson, kebbet, Mista-Flo, costdev, amin7, mukesh27.
Fixes #57574.


git-svn-id: https://develop.svn.wordpress.org/trunk@55198 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 22:46:02 +00:00
Jb Audras
95503d5abc Plugins: Rephrase Add Plugins screen description for better clarity.
This changeset rephrases the Add Plugins screen description to clarify the purpose of the two available options for installing plugins.

Props tahmidulkarim, audrasjb, costdev, ryokuhi, krupalpanchal, SergeyBiryukov.
Fixes #57155.


git-svn-id: https://develop.svn.wordpress.org/trunk@55197 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 21:48:11 +00:00
Jb Audras
522c6b83d1 I18N: Pass $locale parameter to override_load_textdomain filter.
In [53874] the `$locale` parameter was added to `load_textdomain()` so it can be used to properly fill `WP_Textdomain_Registry`. Since `$locale` may not be the same value as `determine_locale()` returns (e.g. when filtered by `plugin_locale` in `load_plugin_textdomain()`) this changeset also passes the `$locale` parameter to the filter so custom file loading implementations are using the same locale as `load_textdomain()` got.

Follow-up to [53874].

Props ocean90, cadic, SergeyBiryukov, swissspidy, costdev.
Fixes #57056.


git-svn-id: https://develop.svn.wordpress.org/trunk@55196 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 21:29:53 +00:00
Jb Audras
b46bb7715c Help/About: Update help tab texts to consistently describe button labels.
This changeset ensures help tab texts consistently refer to the related button labels.

Props kebbet, costdev.
Fixes #57608.


git-svn-id: https://develop.svn.wordpress.org/trunk@55195 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 20:23:01 +00:00
Jorge Costa
e53d61ac01 Editor: Remove need for template prefix in get_template_hierarchy.
This commit removes the need to pass a template prefix in get_template_hierarchy.
This is required because, in some block editor usages, the template prefix is not known.

Props youknowriad, davidbaumwald, jorgefilipecosta.
Fixes #57614.

git-svn-id: https://develop.svn.wordpress.org/trunk@55194 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 19:36:29 +00:00
Felix Arntz
99702c84eb Editor: Remove unnecessary CSS comments from compiled styles.
Props aristath, adamsilverstein, SergeyBiryukov, gziolo.
Fixes #56388.


git-svn-id: https://develop.svn.wordpress.org/trunk@55193 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 18:57:39 +00:00
Felix Arntz
7b43a6da54 Editor: Add support for custom CSS in global styles.
This changeset introduces functions `wp_get_global_styles_custom_css()` and `wp_enqueue_global_styles_custom_css()`, which allow accessing and enqueuing custom CSS added via global styles.

Custom CSS via global styles is handled separately from custom CSS via the Customizer. If a site uses both features, the custom CSS from both sources will be loaded. The global styles custom CSS is then loaded after the Customizer custom CSS, so if there are any conflicts between the rules, the global styles take precedence.

Similarly to e.g. [55185], the result is cached in a non-persistent cache, except when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.

Props glendaviesnz, oandregal, ntsekouras, mamaduka, davidbaumwald, hellofromtonya, flixos90.
Fixes #57536.


git-svn-id: https://develop.svn.wordpress.org/trunk@55192 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 18:50:54 +00:00
Jonathan Desrosiers
61d5704c25 Build/Test Tools: Update npm dependencies.
This updates the following npm dependencies to their latest versions:

- `chalk` from `5.1.0` to `5.2.0`.
- `dotenv-expand` from `9.0.0` to `10.0.0`.
- `grunt-contrib-qunit` from `6.2.0` to `6.2.1`.
- `prettier` from `2.0.5` to `2.6.2`.
- `qunit` from `2.19.1` to `2.19.4`.
- `sass` from `1.55.0` to `1.58.0`.
- `sinon` from `14.0.1` to `15.0.1`.
- `sinon-test` from `3.1.4` to `3.1.5`.
- `source-map-loader` from `4.0.0` to `4.0.1`.
- `uglify-js` from `3.17.3` to `3.17.4`.
- `wait-on` from `6.0.1` to `7.0.1`.
- `webpack` from `5.74.0` to `5.75.0`.

Additionally, `npm audit fix` has been run to further update packages that may contain vulnerabilities.

Props naeemhaque, mukesh27, desrosj.
See #57535.

git-svn-id: https://develop.svn.wordpress.org/trunk@55191 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 16:34:04 +00:00
Sergey Biryukov
60bc074dee Coding Standards: Rename the $cat_ID variable to $cat_id in wp_update_category().
This resolves a few WPCS warnings:
{{{
Variable "$cat_ID" is not in valid snake_case format, try "$cat_i_d"
}}}

Follow-up to [2695], [4490], [52958].

Props hilayt24, viralsampat, desrosj, robinwpdeveloper, tanazmasaba, costdev, SergeyBiryukov.
See #56754.

git-svn-id: https://develop.svn.wordpress.org/trunk@55190 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 13:57:48 +00:00
Jb Audras
0c97bbc118 Twenty Twenty-Two: Improve spacing for the legacy Post Comments block.
This changeset adds margins to improve spacing in the legacy Post Comments block. This change only affects users who have not updated to the new Comments block.

Props patelhitesh, audrasjb, poena, miguelaxcar.
Fixes #57560.


git-svn-id: https://develop.svn.wordpress.org/trunk@55189 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 09:23:21 +00:00
Jb Audras
d955c72056 Themes: Increase HTTP timeout for Theme API requests.
This changeset modifies the HTTP request in `themes_api()` to use the same HTTP request timeout as in `plugins_api()`, which is 15 seconds, instead of a default value of 5 seconds.

Props ahortin, peterwilsoncc, dd32, costdev.
Fixes #57315.


git-svn-id: https://develop.svn.wordpress.org/trunk@55188 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 09:12:12 +00:00
Joe Dolson
dfca88265e Media: Fix inconsistent font weight in media detail views.
Make font weight consistent between different screens and different parts of media views.
 
Props szaqal21, sabernhardt.
Fixes #54509.

git-svn-id: https://develop.svn.wordpress.org/trunk@55187 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 02:14:02 +00:00
Andrew Ozz
4dd9160d8e Emoji: Always skip nodes with the wp-exclude-emoji CSS class.
Patches twemoji.js to add support for a `doNotParse()` callback. Uses that callback to always exclude emojis in HTML elements with the above class.

Props: dd32, peterwilsoncc, azaozz.
Fixes #52219.

git-svn-id: https://develop.svn.wordpress.org/trunk@55186 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-02 00:51:02 +00:00
Felix Arntz
6b4b2eb60f Editor: Use a non-persistent object cache instead of transient in wp_get_global_stylesheet().
This changeset is part of a greater effort to enhance the caching strategy for theme.json based data. Similar to [55138], [55148], and [55155], the cache is currently ignored when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.

Props spacedmonkey, oandregal, flixos90, ajlende, hellofromtonya.
Fixes #57568.


git-svn-id: https://develop.svn.wordpress.org/trunk@55185 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 22:57:04 +00:00
Tonya Mork
888e139a94 KSES: Allow position-related CSS properties.
Adds support for the following CSS properties considered safe for inline CSS:
* `position`
* `top`
* `right`
* `bottom`
* `left`
* `z-index`

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

Follow-up to [54117].

Props andrewserong, mukesh27.
Fixes #57504.

git-svn-id: https://develop.svn.wordpress.org/trunk@55184 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 22:50:11 +00:00
Joe Dolson
26c92e5e03 Media: Ensure media IDs are type int in bulk editing.
Cast all array values to integers using `array_map` so functions like `wp_delete_attachment` receiving the expected variable type.
 
Props eherman24, joedolson.
Fixes #56170.

git-svn-id: https://develop.svn.wordpress.org/trunk@55183 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 22:15:04 +00:00
Jb Audras
8e091f6156 Embeds: Add oEmbed support for crowdsignal.net surveys.
Crowdsignal has a block-editor powered survey/project editor. Surveys created using this editor appear on `*.crowdsignal.net` when published. This changeset adds oEmbed support for these URLs to embed Crowdsignal surveys.

Props donncha, audrasjb, Mamaduka, ntsekouras.
Fixes #57543.


git-svn-id: https://develop.svn.wordpress.org/trunk@55182 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 21:43:27 +00:00
Tonya Mork
8edf0e8900 Editor: Add 'wp-polyfill' to _wp_get_iframed_editor_assets() for inert attribute in Firefox.
Adds the polyfill script to the iframe to make the `inert` attribute work correctly in Firefox. This solves the problem that the site editor can operate on the block editor in Firefox even in browse mode.

Why?

The inert attribute is intended to render the element and its sub-tree elements `inert`, but Firefox doesn't support this attribute. For the `inert` attribute to work as intended in Firefox, even within an iframe, the script needs to be injected into the iframe as well as the global document.

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

Follow-up to [53160].

Props wildworks, mamaduka, youknowriad.
Fixes #57552.

git-svn-id: https://develop.svn.wordpress.org/trunk@55181 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 20:42:23 +00:00
Joe Dolson
4c81af47fa Media: Remove meta data after restoring w/IMAGE_EDIT_OVERWRITE.
When IMAGE_EDIT_OVERWRITE is defined as true the meta field `_wp_attachment_backup_sizes` is deleted after an image is restored.
 
Props mitogh, jeawhanlee, robinwpdeveloper, iapial.
Fixes #55150.

git-svn-id: https://develop.svn.wordpress.org/trunk@55180 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 20:29:56 +00:00
Tonya Mork
bd0ab0cddf Editor: Separate content styles for iframe in __wp_get_iframed_editor_assets() and wp_default_styles().
This changeset:
* Removes the `'wp-block-editor'` and `'wp-block-library'` from the iframe's stylesheet collection (i.e. `_wp_get_iframed_editor_assets()`).
* Adds the new `'wp-block-editor-content'` for the separate stylesheet to the list of editor (`'wp-edit-blocks'`) dependencies.

Why?

These PHP changes are part of the initiative to:

* Separate the content styles contained in the block editor package into a separate stylesheet.
* Avoid loading all block editor styles into the iframe.

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

Follow-up to [53160], [50761].

Props ellatrix, youknowriad.
Fixes #57550.

git-svn-id: https://develop.svn.wordpress.org/trunk@55179 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 20:15:38 +00:00
Joe Dolson
58bc356fb0 Media: Fix upload not visible if added after deleting media.
Unset GET parameters in the media library so they don't suppress error notifications and messages. Fix an issue where uploading an image after being redirected from deleting media did not show the new upload in the gallery.
 
Props rnitinb, Mista-Flo, desrosj, zebaafiashama, joedolson, antpb.
Fixes #49178.

git-svn-id: https://develop.svn.wordpress.org/trunk@55178 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 19:45:53 +00:00
Tonya Mork
36da826901 REST API: Declare 'edit_css' capability in links within WP_REST_Global_Styles_Controller.
Updates the Global Styles endpoint to expose the `'edit_css'` capability via action links.

References:
* [https://github.com/WordPress/gutenberg/pull/46815 Gutenberg PR 46815] Part of an effort to hide custom CSS setting for users without `'edit_css'` capability.

Follow-up to [52342], [52051].

Props mamaduka, dsas, glendaviesnz, mmtr86, talldanwp, timothyblynjacobs.
Fixes #57526.

git-svn-id: https://develop.svn.wordpress.org/trunk@55177 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 18:36:08 +00:00
Tonya Mork
7374cdeb74 Themes: Add shadow presets support for theme.json.
Adds shadow presets support for `theme.json` within the `WP_Theme_JSON` by 

* Adding it to presets metadata and valid settings.
* Defining the default shadow presets in Core's `theme.json`.

Includes PHPUnit tests. 

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

Follow-up to [54162], [52049], [50973].

Props madhudollu, mamaduka, oandregal, scruffian, hellofromTonya.
Fixes #57559.

git-svn-id: https://develop.svn.wordpress.org/trunk@55176 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 18:05:44 +00:00
Tonya Mork
f3b858cb98 Editor: Introduce minimum height dimensions block support.
This changeset adds the new dimension feature's PHP code for supporting minimum height in the block editor inspector and in global styles. Minimum height is quite useful for defining the minimum vertical dimensions of a block, while allowing it to expand beyond that size. 

In this changeset:

* Adds support in `theme.json`.
* Adds support in the style engine.
* Adds support in `wp_apply_dimensions_support()`.
* Renames the setting from `'__experimentalDimensions'` to `dimensions` in `wp_register_dimensions_support()`.
* Adds PHPUnit tests.

Is renaming `'__experimentalDimensions'` a backwards-compatibility (BC) break?

Though the setting has been in the code since 5.9.0, it was never wired to anything, ie it did not expose any controls or styles. Notice in `wp_register_dimensions_support()` and `wp_apply_dimensions_support()` prior to this changeset, there are inline comments as placeholders for height and width support, but no code.

If a developer opted in to use it, it had no effect.

A search in wp.org's plugin and themes repo showed no instances of this experimental setting.

Given there was no functionality attached to it (until this changeset), no change in behavior or effect from removing it, and no usage found in the plugins and themes repository, it does appear to be a BC break.

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

Follow-up to [53076], [52069].

Props andrewserong, aaronrobertshaw , costdev, hellofromTonya, isabel_brison, joen, paaljoachim, mukesh27, ntsekouras, oandregal, ramonopoly.
Fixes #57582.

git-svn-id: https://develop.svn.wordpress.org/trunk@55175 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 16:13:49 +00:00
Sergey Biryukov
8604838832 Docs: Document the inserter property in WP_Block_Patterns_Registry::register().
Follow-up to [53152], [55173].

See #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55174 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 15:27:14 +00:00
Sergey Biryukov
d2f6c417ff Docs: Improve documentation for block pattern properties.
Includes:
* Adding the `templateTypes` property to the `WP_Block_Patterns_Registry::register()` DocBlock.
* Adding `@since` notes for the `postTypes` and `templateTypes` properties to:
 * `_register_theme_block_patterns()`
 * `WP_Block_Patterns_Registry::register()`
* Bringing some consistency to the order of properties between:
 * `_register_theme_block_patterns()`
 * `WP_Block_Patterns_Registry::register()`
 * `WP_REST_Block_Patterns_Controller::prepare_item_for_response()`
 * `WP_REST_Block_Patterns_Controller::get_item_schema()`

Follow-up to [52943], [53152], [54263], [55168].

See #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55173 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 15:00:19 +00:00
Tonya Mork
52e5e065b3 Editor: Add support for editing block style variations in global styles.
To allow editing of block style variations in global styles, this changeset adds the following for server side support:

* building of block style schema into `WP_Theme_JSON::sanitize()`.
* appending of style variation selectors to block metadata in `WP_Theme_JSON::get_blocks_metadata()`.
* building of selectors and variations for nodes in `WP_Theme_JSON::get_block_nodes()`.

Tests for happy and unhappy paths are included.

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

Follow-up to [54118], [50973], [50959].

Props isabel_brison, 
Fixes #57583.

git-svn-id: https://develop.svn.wordpress.org/trunk@55172 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-01 13:41:16 +00:00
Felix Arntz
6036ee03af Media: Allow to omit decoding="async" on tags from wp_get_attachment_image().
When adding `decoding="async"` to images was introduced in [53480], it did not provide the ability to customize that behavior specifically for image tags returned from `wp_get_attachment_image()`.

With this changeset it is now possible to explicitly provide a `decoding` value of e.g. boolean `false` in the `$attr` parameter of the function, to ensure the attribute is omitted.

Props maximej, adamsilverstein, flixos90, costdev, peterwilsoncc, mukesh27.
Fixes #57086.


git-svn-id: https://develop.svn.wordpress.org/trunk@55171 602fd350-edb4-49c9-b593-d223f7449a82
2023-01-31 19:39:51 +00:00
John Blackbourn
a4d42f09d9 Cron API: Improve the docs for some cron event and cron schedule related functions.
See #56792


git-svn-id: https://develop.svn.wordpress.org/trunk@55170 602fd350-edb4-49c9-b593-d223f7449a82
2023-01-31 17:48:45 +00:00
Jonny Harris
4ca85e7528 Query: Use WP_Query in get_page_by_path.
Replace raw database queries in `get_page_by_path` with a call to `WP_Query` class. This has a number of benefits, including improved caching and priming of post caches. To maintain backwards compatibility, this function calls `WP_Query` to gets all matching posts of all post statuses.  

Props spacedmonkey, peterwilsoncc, costdev, 
Fixes #56689.

git-svn-id: https://develop.svn.wordpress.org/trunk@55169 602fd350-edb4-49c9-b593-d223f7449a82
2023-01-31 16:54:22 +00:00