47913 Commits

Author SHA1 Message Date
Isabel Brison
bd76e7bf5c Editor: revert add grid layout type
Reverting the previous commit because it causes e2e to fail on trunk.

See #58554.


git-svn-id: https://develop.svn.wordpress.org/trunk@55958 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 06:56:18 +00:00
Isabel Brison
c95db6bf0e Editor: add grid layout type
Add a new `grid` type to the layout block support.

Props andrewserong, costdev, ramonopoly.
Fixes #58554.


git-svn-id: https://develop.svn.wordpress.org/trunk@55957 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 05:54:27 +00:00
Isabel Brison
cfe8ab9b20 Editor: update layout classnames and specificity.
Adds a compound layout classname and reduces layout spacing rule specificity.

Props ramonopoly, andrewserong, poena.
Fixes #58548.


git-svn-id: https://develop.svn.wordpress.org/trunk@55956 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 05:30:24 +00:00
Isabel Brison
b35b1fcc86 Editor: add Post Content attributes to block editor settings.
Adds a new block editor setting containing the Post Content block attributes, if they exist.

Props audrasjb, spacedmonkey, jeremyfelt, mukesh27, flixos90, andrewserong.
Fixes #58534.


git-svn-id: https://develop.svn.wordpress.org/trunk@55955 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 04:21:04 +00:00
Joe Dolson
0b6911113b Administration: Make checkbox column clickable.
Change the `label` for `.check-column` inside list tables to a block filling the entire cell. Improves accessibility by increasing the target area for the control.

Props mitchoyoshitaka, lessbloat, sabernhardt, ogleker, tacoverdo, joostdevalk, karmatosed.

Fixes #21516.

git-svn-id: https://develop.svn.wordpress.org/trunk@55954 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 01:52:16 +00:00
Joe Dolson
c71fad7e48 Login and Registration: Add required to Username/password inputs.
Add the `required` attributes to username and password inputs for login.

Props aznadesign, sanchothefat, alexstine, nant82, swissspidy, afercia, d-signed, joedolson.
Fixes #32510.

git-svn-id: https://develop.svn.wordpress.org/trunk@55953 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 22:46:52 +00:00
Jb Audras
962e8d1a31 Docs: register_block_style() docblock improvement.
This changeset replaces `style` with `style_handle` in the description of `$style_properties` to better match `WP_Block_Styles_Registry::register()`.

Follow-up to [46111], [48102].

Props bacoords, dilipbheda, audrasjb.
Fixes #58562.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@55952 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 22:40:27 +00:00
Jb Audras
1e8b61bd4d REST API: Indicate when a theme supports the Site editor in the Themes REST API response.
This changeset adds a `is_block_theme` property to each theme in the `wp/v2/themes` API response, which uses `WP_Theme::is_block_theme` to determinate whether 
the theme is block theme or not.

Props grantmkin, ironprogrammer, zunaid321, azaozz, spacedmonkey, audrasjb, costdev.
Fixes #58123.




git-svn-id: https://develop.svn.wordpress.org/trunk@55951 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 22:15:57 +00:00
Felix Arntz
9bc6b0a060 Editor: Introduce WP_Theme_JSON::prepend_to_selector() to improve code quality and performance.
The `WP_Theme_JSON::append_to_selector()` method was previously used for both appending and prepending which violated the single responsibility principle. It resulted in additional conditionals which also came at a performance cost, particularly because the method is called over 1,000 times during a regular WordPress request.

With the new `WP_Theme_JSON::prepend_to_selector()` method, there are now two distinct methods for the two distinct purposes. The now useless third parameter on `WP_Theme_JSON::append_to_selector()` has been removed (rather than deprecated), which is acceptable given that it is a protected method on a class that is not intended for extensions.

Props bor0, costdev, flixos90, isabel_brison, oandregal, spacedmonkey.
Fixes #58193.
See #58457.


git-svn-id: https://develop.svn.wordpress.org/trunk@55950 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 17:52:32 +00:00
Sergey Biryukov
b17064a082 Media: Display the “Copy URL” and “Download file” row actions when the “Unattached” filter is applied.
Due to partially duplicated logic for displaying row actions in the Media Library with and without the “Unattached” filter, the “Copy URL” and “Download file” row actions were unintentionally missing with the filter applied.

This commit aims to simplify the logic and bring more consistency to the code.

Includes displaying the “Download file” row action even when the “Trash” filter is applied, giving the user one more chance to download the media file before they delete it.

Follow-up to [8901], [13100], [16227], [16229], [52842], [55198], [55221].

Props kebbet, costdev, pbiron, oglekler, SergeyBiryukov.
Fixes #57890, #57893.

git-svn-id: https://develop.svn.wordpress.org/trunk@55949 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 15:45:23 +00:00
Sergey Biryukov
76376fdbc3 Coding Standards: Use strict comparison in wp-includes/pomo/translations.php.
Follow-up to [10584], [12079].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55948 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 08:19:51 +00:00
Isabel Brison
787de79119 Editor: use logarithmic scale for fluid typography.
Introduces logarithmic scale factor to calculate a minimum font scale that tapers out as the font size increases.

Props ramonopoly.
Fixes #58523.


git-svn-id: https://develop.svn.wordpress.org/trunk@55947 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 07:58:03 +00:00
Isabel Brison
c790ae481b Editor: use layout.wideSize as max viewport width.
Use the value of `layout.wideSize` as the maximum viewport width for fluid font size calculations.

Props ramonopoly.

Fixes #58522.



git-svn-id: https://develop.svn.wordpress.org/trunk@55946 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 05:26:47 +00:00
Isabel Brison
da008c74a7 General: fix overridden typos.
Fixes two typos in `class-wp-theme-json`.

Props Aristath, nihar007, kapilpaul, oandregal, krupalpanchal.
Fixes #58464.


git-svn-id: https://develop.svn.wordpress.org/trunk@55945 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 04:57:27 +00:00
Peter Wilson
2b7f865417 KSES: Add support for CSS repeat() function.
Introduces support for the CSS `repeat()` function to support complex grid layouts.

Props isabel_brison, azaozz.
Fixes #58551.


git-svn-id: https://develop.svn.wordpress.org/trunk@55944 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-20 02:29:18 +00:00
Peter Wilson
6966e31934 Media: Redirect deprecated wp-admin/media.php file.
Redirect users visiting the `wp-admin/media.php` file to the media library, `wp-admin/upload.php`. An user facing warning is displayed when the media library is reached via a deprecated link.

Follow up to [55647].

Props jorbin, audrasjb, azaozz, NekoJonez, kebbet, costdev.
Fixes #57612.



git-svn-id: https://develop.svn.wordpress.org/trunk@55943 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 23:18:28 +00:00
John Blackbourn
75d7208741 General: Replace some instances of "blog" with "site" in documentation, translator comments, and user-facing text strings.
This is not an exhaustive change, but it gets us closer to using "site" in place of "blog" in as many places as possible.

Props NekoJonez, audrasjb, oglekler

Fixes #58117


git-svn-id: https://develop.svn.wordpress.org/trunk@55942 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 18:26:01 +00:00
Jonny Harris
a14bc9b298 Themes: Change the order of path check in is_block_theme method.
Change check to see if the current theme is a block theme, to check the path `/templates/index.html` first over the deprecated path `/block-templates/index.html`. 
As this path was deprecated in WP 5.9, it is more likely the block theme would use the current path. This saves a file_exists call which improves performance. 

Props nihar007, spacedmonkey.
Fixes #58520.

git-svn-id: https://develop.svn.wordpress.org/trunk@55941 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 16:02:41 +00:00
Sergey Biryukov
b2cb29aaf9 Cache API: Remove unused usermeta global cache group.
The `usermeta` group was introduced in WP 2.0, but was never actually used in WordPress core.

The `user_meta` group is used instead.

Follow-up to [3011], [15482], [16562], [53823], [53832], [54940].

Props ignatggeorgiev, peterwilsoncc, oglekler, pamprn09, spacedmonkey, SergeyBiryukov.
Fixes #58175.

git-svn-id: https://develop.svn.wordpress.org/trunk@55940 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 11:42:46 +00:00
Jonny Harris
ea0a4881ae Themes: Fix caching issue in get_post_templates method in WP_Theme.
Fix an edge case caching issue, where if a developer use the  `wp_cache_themes_persistently` filter and is running the site in multisite configuration, it meant block template are incorrectly cached. Block templates are stored in the posts table. But in a multisite configuration, different sites on the multisite could have different block templates stored in there post table. As themes cache group is a global group, it resulted in incorrect values being cached.

Props maniu, spacedmonkey, hellofromTonya, oglekler, mukesh27, joemcgill.
Fixes #57886.

git-svn-id: https://develop.svn.wordpress.org/trunk@55939 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 10:31:45 +00:00
Peter Wilson
7cfc7a46f9 Filesystem API: Attempt to create directory in copy_dir().
Adds a check to the start of `copy_dir()` that the destination directory exists and attempts to create it if it does not.

An error is returned if the directory can not be created, either due to a permissions error or the parent directory not existing.

Props caraffande, costdev, zunaid321.
Fixes #41855.



git-svn-id: https://develop.svn.wordpress.org/trunk@55938 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-19 01:58:25 +00:00
Joe Dolson
1e090291f0 Formatting: Support aria content attributes.
Add `aria-controls`, `aria-expanded`, and `aria-current` to allowed attributes in KSES.

Props crs1138, rsiddharth, mukesh27, SergeyBiryukov, joedolson, ryokuhi, peterwilsoncc, audrasjb, nataliat2004.
Fixes #55370.

git-svn-id: https://develop.svn.wordpress.org/trunk@55937 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-18 16:39:05 +00:00
Joe Dolson
c916ebde8a Media: Remove duplicate div containers.
Follow-up to [55919]. Remove two hidden divs accidentally duplicated in patch refreshing.

Props azaozz.
Fixes #50523.

git-svn-id: https://develop.svn.wordpress.org/trunk@55936 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-18 16:09:47 +00:00
Andrew Ozz
bcb881c17f Media: Deprecate the 'edit_custom_thumbnail_sizes' filter and disable the "Apply changes to [Thumbnail|All|All except thumbnail]" UI in the image editor. Add a (boolean) filter to reenable that UI.
Props peterwilsoncc, costdev, azaozz.
See: #57685.

git-svn-id: https://develop.svn.wordpress.org/trunk@55935 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-18 14:22:40 +00:00
Sergey Biryukov
be7dc79427 Coding Standards: Use strict comparison in wp-includes/pomo/streams.php.
Follow-up to [10584], [11626], [12174].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55934 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-18 12:53:47 +00:00
Joe Dolson
ca6a093af2 Upgrade/Install: Log in link should look like a link.
Change the log in link that appears after completing installation so that it does not use the button styling. Links should look like links.

Props xavortm, menakas, afercia, rianrietveld, johnbillion, drw158, joedolson.
Fixes #40470.

git-svn-id: https://develop.svn.wordpress.org/trunk@55933 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-17 21:45:52 +00:00
Joe Dolson
96de776ed9 Bundled Themes: Fix Twenty Fourteen button block line-height.
Change the button block in Twenty Fourteen to use relative instead of fixed line-height. Prevent visual errors with larger font sizes on the front-end.

Props nidhidhandhukiya, algorithmsunlocks, mayur8991, sabernhardt.
Fixes #58444.

git-svn-id: https://develop.svn.wordpress.org/trunk@55932 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-17 21:35:25 +00:00
Sergey Biryukov
fbef5030f6 Coding Standards: Use strict comparison in wp-includes/pomo/mo.php.
Follow-up to [10584], [12174].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55931 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-17 10:26:24 +00:00
Jonny Harris
3e2121c83d Themes: Inline render blocking CSS `classic-themes.css'
Since [54358], a new CSS file classic-themes.css is enqueued on all pages on the front end of themes without `theme.json`. This is a blocking http request, the impact on performance will be affected by network conditions. Inlining this style, stops this blocking request. By adding style data of path to the registered style, the function `wp_maybe_inline_styles` will automatically inline the style for us. 

Props spacedmonkey, adamsilverstein.
Fixes #58480.

git-svn-id: https://develop.svn.wordpress.org/trunk@55930 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-16 13:26:34 +00:00
Pascal Birchler
1d1a2e3dec Bundled Themes: Remove load_theme_textdomain() calls from default themes.
Since WordPress 4.6 introduced just-in-time translation loading, themes and plugins no longer need to manually call `load_theme_textdomain`/`load_plugin_textdomain`, unless they are on a version prior to 4.6.

This change removes the `load_theme_textdomain()` call from Twenty Seventeen and up, since these themes all require at least WordPress 4.7.
On older default themes, `load_theme_textdomain()` is called conditionally depending on the WordPress version.

Props piyushtekwani.
Fixes #58318.

git-svn-id: https://develop.svn.wordpress.org/trunk@55929 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-16 13:03:00 +00:00
Pascal Birchler
6048eb34be I18N: Allow to short-circuit load_textdomain().
Introduces a new `pre_load_textdomain` filter, which is useful for plugins to develop and test alternative loading/caching strategies for translations. This brings consistency with the existing `pre_load_script_translations` filter for JavaScript translations.

Props ocean90, swissspidy.
Fixes #58035.

git-svn-id: https://develop.svn.wordpress.org/trunk@55928 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-16 12:56:03 +00:00
Sergey Biryukov
a1673dccae Coding Standards: Use strict comparison in wp-includes/pomo/entry.php.
Follow-up to [18528].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55927 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-16 11:21:59 +00:00
André
be395bf73a Themes: add wp_get_remote_theme_patterns function.
Adds a new public function, `wp_get_remote_theme_patterns` to query the `patterns` datum from `theme.json` and substitutes current usage of private APIs.

Props ntsekouras, poena, audrasjb.
Fixes #58460



git-svn-id: https://develop.svn.wordpress.org/trunk@55926 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-16 08:06:30 +00:00
Peter Wilson
9fe8cdf126 Tests/Build tools: Various term related test improvements.
Modifies the tests for `get_tag_link()`, `get_term()` and `get_term_field()` to:

- use shared fixtures as possible
- improves variable names
- add `@covers` annotation as required

Props peterwilsoncc, costdev.
See #57841.


git-svn-id: https://develop.svn.wordpress.org/trunk@55924 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-15 03:23:25 +00:00
Sergey Biryukov
8a5411bcba Posts, Post Types: Introduce item_trashed post type label.
This allows the block editor to announce the correct message when an entity is moved to the Trash.

Original issue from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/issues/19144 #19144 Wrong notification message shown when an entity is moved to trash]

Props james-roberts, ntsekouras, nrqsnchz, afercia, swissspidy, joedolson, talldanwp, SergeyBiryukov.
Fixes #51387.

git-svn-id: https://develop.svn.wordpress.org/trunk@55923 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-15 01:37:09 +00:00
Peter Wilson
8e33397550 Tests/Build tools: Add @covers annotation to wp_set_object_terms() tests.
Props @costdev.
See #57841.


git-svn-id: https://develop.svn.wordpress.org/trunk@55922 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-15 00:00:47 +00:00
Peter Wilson
6178829ab0 Taxonomy: Prevent deprecation notices clearing terms.
Prevents `wp_set_object_terms()` throwing a deprecation notice in PHP 8.1+ when passing an empty value as the second parameter to clear the terms.

Props audrasjb, chouby, costdev, jrf, peterwilsoncc, prashantbhivsane, sergeybiryukov.
Fixes #57923.


git-svn-id: https://develop.svn.wordpress.org/trunk@55921 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 23:49:36 +00:00
Joe Dolson
a5db7658be Build/Test Tools: Revert accidental change to .env
Follow-up to [55919] to restore .env state.

Props joedolson.
See #50523.

git-svn-id: https://develop.svn.wordpress.org/trunk@55920 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 20:44:53 +00:00
Joe Dolson
3a9893b7cc Media: Update admin image editor design.
Significant restructure of the admin image editor interface, but no new functionality. Reorganize editing buttons into a common region at the top of the editor. Move image rotation tools into a pop-out menu. Add 180 degree rotation option. Add scale button to control group. Move sidebar tools next to the editing canvas to improve visual proximity between action and result. Enlarge editing canvas and crop handles. Separate activating crop functions from applying crop. Add numeric inputs for crop & scale values. 

A long term goal is to move undo/redo and cancel/save into the modal title bar, but that is not feasible without significant updates to the modal framework.

Props afercia, karmatosed, nrqsnchz, antpb, chaion07, costdev, peterwilsoncc, antpb, sabernhardt, prashantbhivsane, joedolson.
Fixes #50523.

git-svn-id: https://develop.svn.wordpress.org/trunk@55919 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 20:40:42 +00:00
Jb Audras
8b9691ab24 Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Follow-up to [55911], [55916], [55917].

Props costdev.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@55918 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 14:09:23 +00:00
Jb Audras
6837a90e49 Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Follow-up to [55911], [55916].

Props costdev.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@55917 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 14:06:03 +00:00
Jb Audras
1807432cd2 Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Follow-up to [55911].

Props costdev, audrasjb.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@55916 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 12:55:11 +00:00
André
5d544a5c69 Fix lint issues in WP_Theme_JSON::sanitize method.
Add @since tag and indent the parameter properly.

Props mukesh27.
Fixes #58462.



git-svn-id: https://develop.svn.wordpress.org/trunk@55915 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 10:44:12 +00:00
Sergey Biryukov
2888dafcab Coding Standards: Use strict comparison in wp-includes/class-wp-oembed.php.
Follow-up to [13996].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55914 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 10:33:37 +00:00
Jb Audras
1ade93bb06 Twenty Seventeen: Improve Grid View variation rendering in the editor for the Post List block.
This changeset updates Twenty Seventeen's block editor stylesheet to remove an unwanted `disc` list style on the "Grid" variation of the Post List block.

Props nkeller15, sabernhardt.
Fixes #58531.




git-svn-id: https://develop.svn.wordpress.org/trunk@55913 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 10:02:36 +00:00
André
3a4e746807 Ignore unregistered block style variations from theme.json.
This PR makes sure unregistered block style variations declared via `theme.json` are ignored. It fixes an issue by style variations don't work in the editor and CSS rules without a selector are output to the front-end.

Props isabel_brison.
Fixes #58462.



git-svn-id: https://develop.svn.wordpress.org/trunk@55912 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 07:40:50 +00:00
Jb Audras
f0caeb5d3c Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Props costdev, audrasjb.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@55911 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-14 06:32:14 +00:00
Jonny Harris
0bfc842f80 Editor: Skip file_exist check for core blocks.
In `register_block_type_from_metadata` function, skip calling `file_exists` on core blocks. Core blocks are part of the codebase and will never not exist. Not calling this function is better for performance, as the file lookup can be expensive. 

Props spacedmonkey, joemcgill.
Fixes #58385.

git-svn-id: https://develop.svn.wordpress.org/trunk@55910 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-13 11:44:14 +00:00
Jonny Harris
559e6cecf4 Script Loader: Add a check to see in style is registered in wp_maybe_inline_styles.
Add a check in `wp_maybe_inline_styles` to check that style is registered before processing items in queue. It is possible that developers may have called `wp_deregister_style`, unregistering style but the style still be in the queue to be processed. Without this check, typing to access the `src` property would result in a notice error. 

Follow on from [55888]. 

Props spacedmonkey, flixos90, dd32, kebbet.
See #58394.

git-svn-id: https://develop.svn.wordpress.org/trunk@55909 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-13 09:51:11 +00:00
Sergey Biryukov
13f85b4365 Coding Standards: Use strict comparison in wp-includes/class-wp-list-util.php.
Follow-up to [18606], [38928], [48413].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55908 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-13 04:44:40 +00:00