43266 Commits

Author SHA1 Message Date
Sergey Biryukov
919019865a Docs: Revert documentation change for wp_get_attachment_metadata().
This more accurately describes the behavior of the function, and is more consistent with the documentation for other post and attachment functions.

Follow-up to [50039].

Props Mista-Flo.
See #52196.

git-svn-id: https://develop.svn.wordpress.org/trunk@50051 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 10:40:31 +00:00
Sergey Biryukov
988bbf67bb Coding Standards: Simplify a long condition in WP_Site_Health_Auto_Updates::test_wp_version_check_attached() for better readability.
Follow-up to [50035].

See #52135.

git-svn-id: https://develop.svn.wordpress.org/trunk@50049 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 10:34:29 +00:00
Robert Anderson
bc405697b0 Editor: Update @wordpress npm packages
Update @wordpress npm packages to the latest published versions. This means that
the block editor includes functionality that exists in Gutenberg 9.8.

See #52334.
Props isabel_brison.


git-svn-id: https://develop.svn.wordpress.org/trunk@50048 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 02:01:50 +00:00
Jake Spurlock
8bfe823278 Site Health: Update php update strings to not overpromise performance.
Fixes #52327.

Props chanthaboune, SergeyBiryukov, audrasjb, Clorith, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@50041 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:16:21 +00:00
Jake Spurlock
7447e215b7 Media: Ensure that wp_get_attachment_metadata can return values from the global $post, if avaiable.
In [49084] (for #50679), wp_get_attachment_metadata() was changed to improve performance, but it had the side effect of eliminating the ability to call it with no arguments and have it default to using the global $post.

This change restores that ability, while keeping the performance improvements from the original change.

Fixes #52196.

Props cfinke, hellofromTonya, mukesh27, dilipbheda, Mista-Flo, audrasjb, SergeyBiryukov, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@50039 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:07:21 +00:00
Jake Spurlock
a76f895146 Privacy: Ensure that exported user data reports can't be found with directory listings.
By moving from `.html` to `.php` files, we can prevent directory listings, and ensure that WordPress can load.

Fixes #52299.

Props lucasbustamante, xkon, freewebmentor, SergeyBiryukov, whyisjake. 


git-svn-id: https://develop.svn.wordpress.org/trunk@50037 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 23:45:29 +00:00
Jake Spurlock
448dd9d63c Site Health: Only run the version checks on the main site.
The version checks that are setup in `wp-includes/update.php` do set up the action, but only for the main site.

Fixes #52135.

Props audrasjb, SergeyBiryukov, maxpertici, aaribaud.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@50035 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 23:25:55 +00:00
Joe Dolson
8023f34a6a Revisions: Generate correct number of columns in wp_text_diff.
The function `wp_text_diff` generated an invalid table structure if the $args parameter contained any values. This patch corrects the structure generated by `wp_text_diff` and related usages so that the column count matches the data generated. Additionally, this patch passes arguments to the Revisions screen so that the screen has column headings that reflect the content in each column. Improves the accessibility and usability of the Revisions table.

Props joedolson, mehulkaklotar, afercia, adamsilverstein, zodiac1978, jeremyfelt
Fixes #25473

git-svn-id: https://develop.svn.wordpress.org/trunk@50034 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 21:52:10 +00:00
Joe Dolson
bc3177153d Twenty Twenty: Remove aria-expanded on search modal close button.
The Twenty Twenty search modal uses aria-expanded correctly on the Search button, but toggles the aria-expanded value on the 'close' button. The close button is a different control, however, so the attribute value toggling is uneven. The close button does not toggle any behavior; it only closes a control that has already been opened.

Props alexstine, audrasjb
Fixes #52355

git-svn-id: https://develop.svn.wordpress.org/trunk@50033 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 21:31:42 +00:00
Joe Dolson
482a549085 Administration: Remove italic text to improve readability.
Italicized text can be difficult to read for some people with dyslexia or related forms of reading disorders. This removes italics on a number of larger blocks onpm run grunt rpf text in the admin. This has been a task 5.3; this commit closes the task. Further instances of italicized text should be addressed individually.

Props afercia, xkon, audrasjb
Fixes #47327

git-svn-id: https://develop.svn.wordpress.org/trunk@50032 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 21:02:12 +00:00
Timothy Jacobs
e1c98a744b App Passwords: Improve validation and sanitization of the application name.
Application names are now required to be unique and cannot contain solely whitespace characters. Additionally, invalid characters are now stripped from the application name using `sanitize_text_field()`.

Props Boniu91, hellofromTonya, engahmeds3ed, xkon, francina.
Fixes #51941.


git-svn-id: https://develop.svn.wordpress.org/trunk@50030 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 19:03:42 +00:00
Anthony Burchell
52d751751a Media: Reintroduce caching for Media Library query.
In [50021], caching was removed causing unintended classic block media flows to fail.

Reverts [50021].
See #50025.


git-svn-id: https://develop.svn.wordpress.org/trunk@50029 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 14:49:56 +00:00
Sergey Biryukov
fa1288d20c Accessibility: Administration: Respect the prefers-reduced-motion media query for update icon spinner animations.
The update icon rotation should not occur when the user has opted to reduce motion, for example by selecting the "Reduce motion" option in macOS' preferences or unselecting "Show animations in Windows" in Windows' preferences.

Follow-up to [47813], [50027].

Props xkon, audrasjb, johnbillion.
Fixes #52263. See #51476.

git-svn-id: https://develop.svn.wordpress.org/trunk@50028 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 11:39:50 +00:00
Sergey Biryukov
7a5a5a7939 Plugins: Rotate the Updates icon in the admin bar when performing inline updates on the Plugins screen.
This provides better indication within the viewport about ongoing processes on the page when updating several plugins at the same time, but without using the bulk updater.

Props ravipatel, audrasjb, johnjamesjacoby, paaljoachim, hellofromTonya, sabernhardt, mdwolinski, karmatosed, SergeyBiryukov.
Fixes #51476.

git-svn-id: https://develop.svn.wordpress.org/trunk@50027 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 10:57:43 +00:00
Sergey Biryukov
4ea42e3a71 Twenty Twenty-One: Correct colors for the Menu button.
As per design, the background should be transparent and the text should be dark grey, not vice versa.

Follow-up to [49987].

Props poena.
Fixes #52374. See #51927.

git-svn-id: https://develop.svn.wordpress.org/trunk@50026 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-26 18:58:08 +00:00
Kelly Choyce-Dwan
9f03cdadcb Administration: Standardize colors used in CSS to a single palette.
This is part of a larger project in cleaning up core's admin CSS. This collapses all colors used in the CSS to one of 12 blues, greens, reds, and yellows, 13 grays, pure black, and pure white. The colors are perceptually uniform from light to dark, half of each range has a 4.5 or higher contrast against white, the other half has a 4.5 or higher contrast against black.

Standardizing on this set of colors will help contributors make consistent, accessible design decisions. The full color palette can be seen here: https://codepen.io/ryelle/full/WNGVEjw

Props notlaura, danfarrow, kburgoine, drw158, audrasjb, Joen, hedgefield, ibdz, melchoyce.
See #49999.



git-svn-id: https://develop.svn.wordpress.org/trunk@50025 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-26 18:53:55 +00:00
John Blackbourn
6df02a9ce2 REST API: Introduce modified_before and modified_after query parameters for the posts endpoints.
These parameters work just the same as `before` and `after` except they operate on the post modified date instead of the post published date.

Props claytoncollie, TimothyBlynJacobs, hellofromTonya

Fixes #50617


git-svn-id: https://develop.svn.wordpress.org/trunk@50024 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-26 18:26:13 +00:00
Sergey Biryukov
37f0f960ef Mail: Make sure the SMTP class is only required once if a plugin requires wp-includes/class-smtp.php directly.
Follow-up to [48033], [48530].

Props oellin, greatsaltlake, audrasjb.
Fixes #52369. See #50716, #41750.

git-svn-id: https://develop.svn.wordpress.org/trunk@50022 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-26 13:44:42 +00:00
Anthony Burchell
f8829b3a8d Media: Remove caching from filter by date in media library.
Previously, newly uploaded media attachments were missing when filtering media items by date due to lack of cache invalidation.
Props adamsilverstein, teamdnk, afercia, Mista-Flo, joedolson.
Fixes #50025.


git-svn-id: https://develop.svn.wordpress.org/trunk@50021 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-26 05:24:15 +00:00
Jonathan Desrosiers
9983be3248 Build/Test Tools: Update autoprefixer dependency.
This updates `autoprefixer` from version `9.6.2` to `9.8.6`. This includes changes as a result of running `npm run grunt precommit:css`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@50017 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 14:49:13 +00:00
Jonathan Desrosiers
cd44f9836e Build/Test Tools: Update sinon dependency.
This updates `sinon` from version `9.2.3` to `9.2.4`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@50016 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 13:32:35 +00:00
Sergey Biryukov
004d7a34cf Toolbar: Update Documentation and Support links.
This replaces the Codex URL in the "WordPress" section of the admin bar with the HelpHub URL, and updates the Support link to point to the forums.

Follow-up to [45140], [45412].

Props audrasjb.
Fixes #52352. See #46790, #47239.

git-svn-id: https://develop.svn.wordpress.org/trunk@50015 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 12:52:22 +00:00
Gary Pendergast
ee4c2cf322 Menus: Fix linting errors introduced in [50013].
Props TimothyBlynJacobs.
Fixes #52189.



git-svn-id: https://develop.svn.wordpress.org/trunk@50014 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 06:53:43 +00:00
Gary Pendergast
6840112825 Menus: Make use of wp_resolve_post_date() when updating menu items.
This allows a menu item `post_date` to be set to particular value, rather than only allowing it to be set to "now". In particular, the WordPress Importer can use this to perform faster, more accurate duplicate checks.

Props jmdodd.
Fixes #52189.



git-svn-id: https://develop.svn.wordpress.org/trunk@50013 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 01:22:06 +00:00
Gary Pendergast
e2bb95aa50 Posts: Create a new function for resolving the post date.
`wp_insert_post()` has a few checks using `post_date` and `post_date_gmt`, to determine the correct post date. This functionality is now extracted out into a new `wp_resolve_post_date()` function, allowing the checks to be reused elsewhere.

Props jmdodd.
Fixes #52187.



git-svn-id: https://develop.svn.wordpress.org/trunk@50012 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 01:06:25 +00:00
pento
04237613be Export: Create an export-specific filter for post titles.
Since WordPress 2.5 and 2.6, `post_content` and `post_excerpt` have both had export-specific filters: `the_content_export`, and `the_excerpt_export`, respectively. `post_title`, however, has used `the_title_rss`, which behaves differently in two important ways:

- It strips HTML tags from the string.
- It HTML-encodes the title string.

These behaviours are not ideal for exports, since it changes the post title, resulting in data loss in export files, and incorrect post duplicate matching on import. This changes replaces the usage of `the_title_rss` with a new filter, `the_title_export`. The new filter is intended to be used in the same as `the_content_export` and `the_excerpt_export`.

Props jmdodd, audrasjb.
Fixes #52250.



git-svn-id: https://develop.svn.wordpress.org/trunk@50011 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-25 00:08:02 +00:00
Timothy Jacobs
0ceee0f871 REST API: Support type coercion when validating the enum JSON Schema keyword.
Previously, the `enum` keyword was validated by perform a strict equality check. For `string` types this is generally ok, but it prevented using alternative types like `number` when rich type support isn't available.

Now the same level of type coercion/sanitization is applied when validating `enum` as all other validation checks. This means that a value of `"1"` will be accepted for an `enum` of `[ 0, 1 ]`. Additionally, `object` types now properly ignore key order when checking for equality.

Props yakimun.
Fixes #51911.


git-svn-id: https://develop.svn.wordpress.org/trunk@50010 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-24 16:50:39 +00:00
Sergey Biryukov
e4e24c84de Docs: Correct default value for the number argument of wp_tag_cloud().
Follow-up to [42658].

Props audrasjb, pawki07.
Fixes #52348.

git-svn-id: https://develop.svn.wordpress.org/trunk@50009 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-24 14:06:15 +00:00
Sergey Biryukov
9826935198 Docs: Document globals in dropdown_categories() and dropdown_link_categories().
Props umangvaghela123, pawki07.
Fixes #41504.

git-svn-id: https://develop.svn.wordpress.org/trunk@50008 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-24 13:58:17 +00:00
Timothy Jacobs
15c8166424 REST API: Add more specific error codes for schema validation.
Previously, the majority of JSON Schema validation errors returned a generic `rest_invalid_param` error code. In preparation for #46191, where the underlying validation error code will be exposed, this commit adds specific error codes for each failure scenario.

Fixes #52317.


git-svn-id: https://develop.svn.wordpress.org/trunk@50007 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-24 03:57:39 +00:00
Timothy Jacobs
ffd7fd8168 App Passwords: Extract Basic Auth check into a reusable filterable function.
In [49752] a check was added to prevent creating new Application Passwords if Basic Auth credentials were detected to prevent conflicts. This check takes place in WP-Admin, though a conflict would only arise if Basic Auth was used on the website's front-end.

This commit extracts the Basic Auth check into a reusable function, `wp_is_site_protected_by_basic_auth()`, which can be adjusted using a filter of the same name. This way, a site that uses Basic Auth to protect WP-Admin can still use the Application Passwords feature.

In the future, instead of requiring the use of a filter, WordPress could make a loopback request and check for a `WWW-Authenticate` header to make this detection more robust out of the box.

Props SeBsZ, archon810, aaroncampbell, ocean90, SergeyBiryukov, TimothyBlynJacobs.
Fixes #52066.


git-svn-id: https://develop.svn.wordpress.org/trunk@50006 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-24 02:56:18 +00:00
Timothy Jacobs
bb395706f4 REST API: Support embedding links in rest_preload_api_request().
Props lpawlik, spacedmonkey.
Fixes #51722.


git-svn-id: https://develop.svn.wordpress.org/trunk@50005 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-23 23:25:40 +00:00
Sergey Biryukov
d4eac17e3d App Passwords: Use correct translation function for a heading on Authorize Application screen.
Props akramipro.
Fixes #52351.

git-svn-id: https://develop.svn.wordpress.org/trunk@50003 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-23 13:11:52 +00:00
Sergey Biryukov
d062656b8a Docs: Fix typo in WP_Links_List_Table DocBlock.
Props audrasjb.
Fixes #52349.

git-svn-id: https://develop.svn.wordpress.org/trunk@50002 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-23 07:23:28 +00:00
Sergey Biryukov
21b667b840 External Libraries: First pass at fixing jQuery deprecations in WordPress core and bundled themes.
To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.

This includes many minor adjustments to a wide array of core files.

Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]

Props Clorith, azaozz.
See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50001 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-22 12:30:39 +00:00
Sergey Biryukov
c145ff4a1a 5.7-alpha-50000 🎉🙌❤️
Thank you for the past
Excited for the future
We are #WordPressStrong!

git-svn-id: https://develop.svn.wordpress.org/trunk@50000 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-21 12:37:39 +00:00
Sergey Biryukov
f3d0d8a1c1 Twenty Twenty-One: Consistently use Yoda condition for display_title_and_tagline setting.
Props mukesh27.
Fixes #52329.

git-svn-id: https://develop.svn.wordpress.org/trunk@49994 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-21 12:15:47 +00:00
Sergey Biryukov
2b09df97d8 Twenty Twenty-One: Add missing HTML comments for </header> tag.
This brings some consistency to closing `</header>` tags in theme templates and ensures they all have an associated HTML comment.

Props freewebmentor, mukesh27.
Fixes #52328.

git-svn-id: https://develop.svn.wordpress.org/trunk@49993 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-21 12:08:50 +00:00
Felix Arntz
176a1f53f0 Robots: Introduce Robots API.
This changeset introduces a filter-based Robots API, providing central control over the `robots` meta tag.

* Introduces `wp_robots()` function which should be called anywhere a `robots` meta tag should be included.
* Introduces `wp_robots` filter which allows adding or modifying directives for the `robots` meta tag. The `wp_robots()` function is entirely filter-based, i.e. if no filter is added to `wp_robots`, no directives will be present, and therefore the entire `robots` meta tag will be omitted.
* Introduces the following `wp_robots` filter functions which replace similar existing functions that were manually rendering a `robots` meta tag:
    * `wp_robots_noindex()` replaces `noindex()`, which has been deprecated.
    * `wp_robots_no_robots()` replaces `wp_no_robots()`, which has been deprecated.
    * `wp_robots_sensitive_page()` replaces `wp_sensitive_page_meta()`, which has been deprecated. Its rendering of the `referrer` meta tag has been moved to another new function `wp_strict_cross_origin_referrer()`.

Migration to the new functions is straightforward. For example, a call to `add_action( 'wp_head', 'wp_no_robots' )` should be replaced with `add_filter( 'wp_robots', 'wp_robots_no_robots' )`.

Plugins and themes that render their own `robots` meta tags are encouraged to switch to rely on the `wp_robots` filter in order to use the central management layer now provided by WordPress core.

Props adamsilverstein, flixos90, timothyblynjacobs, westonruter.
See #51511.


git-svn-id: https://develop.svn.wordpress.org/trunk@49992 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-21 01:35:16 +00:00
Jonathan Desrosiers
51fe5978b6 Build/Test Tools: Update CSS files after grunt precommit:css.
This removes instances of the `-moz-user-select` property, which was required until Firefox 68.

Firefox is currently in version 84, so these can safely be removed.

Fixes #52332.

git-svn-id: https://develop.svn.wordpress.org/trunk@49991 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 19:05:39 +00:00
Jonathan Desrosiers
0c227432cd Build/Test Tools: Update more NPM packages
This updates two NPM packages:
- `qunit` from `2.13.0` to `2.14.0`.
- `sinon` from `9.2.2` to `9.2.3`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49990 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 14:40:24 +00:00
Jonathan Desrosiers
f5998c561a Build/Test Tools: Update the uglify-js package.
This updates the `uglify-js` package from version `3.12.4` to `3.12.5`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49989 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 13:33:33 +00:00
Sergey Biryukov
d10b9e9b88 Twenty Twenty-One: Add missing styles for <button> element.
Props poena, slaFFik.
Fixes #52029.

git-svn-id: https://develop.svn.wordpress.org/trunk@49988 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 07:04:32 +00:00
Sergey Biryukov
62b2606d7e Twenty Twenty-One: Clean up Button styles.
This change restructures the Button element styles for better a11y and expected color behaviors. Here what has changed:

- The `button-style()` mixin is now the ''single source or truth'' for how Button should look site-wide.
  - Button Block, File Block, and Search form Blocks all rely on this one mixin.
  - The same styles is also applied to the `<button>` element which appears in widgets, the 404 search form and comments form.
- Improves expected button styles for various conditions and contexts as follows: 
  - User color palette selections for Buttons are retained regardless of a parent block’s color settings or dark-mode.
  - Supports both Default/Filled styles and Outline styles.
  - More consistent `:hover` and `:active` styles.
  - `:focus` styles are now always visible and legible.
- Adds a `--local-color` color variable to scope color relationships to nested blocks.
- Reduces selectors in `style.css` output.
- 1:1 experience between editor and front end button styles.
- Properly supports Dark-mode.

Props allancole, poena, scruffian, megphillips91.
Fixes #51927.

git-svn-id: https://develop.svn.wordpress.org/trunk@49987 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 05:49:28 +00:00
Peter Wilson
0839d27da9 Media: Ensure get_post_status() does not contain half a comment.
Removes a misplaced comment, follow up to [49985].

Props SergeyBiryukov.
Fixes #52326.



git-svn-id: https://develop.svn.wordpress.org/trunk@49986 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 04:58:20 +00:00
Peter Wilson
56939ff70e Media: Ensure get_post_status() returns correct result for attachments.
Prevent `get_post_status()` returning `false` for attachments if the parent post has been deleted. The returned attachment post status is now passed through the `get_post_status` filter.

Add tests for `get_post_status()`.

Props peterwilsoncc, timothyblynjacobs for review.
Fixes #52326.



git-svn-id: https://develop.svn.wordpress.org/trunk@49985 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-20 04:39:24 +00:00
Sergey Biryukov
9264f3ef77 Upgrade/Install: Display version number on the "Re-install now" button on WordPress Updates screen.
This makes the button label more clear and allows for removing unnecessary description.

Props afragen, audrasjb.
Fixes #51774.

git-svn-id: https://develop.svn.wordpress.org/trunk@49984 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-19 16:46:50 +00:00
Jonathan Desrosiers
520b60d05b Build/Test Tools: Update the webpack-dev-server package.
This updates the `webpack-dev-server` package from version `3.11.1` to `3.11.2`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49983 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-19 16:35:25 +00:00
Greg Ziółkowski
f84ebe3fe7 Blocks: Add automatic RTL handlind for block styles registered from metadata
Related Gutenberg issue: https://github.com/WordPress/gutenberg/pull/28274

With this change it is going to be possible to use the same pattern that wp_style_add_data uses for RTL handling. If the block style file with "-rtl.css" is included in addition to the regular style referenced in "block.json" file then it is going to be automatically registered.

Props swisspidy, aristath.
See #52301.



git-svn-id: https://develop.svn.wordpress.org/trunk@49982 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-19 11:48:59 +00:00
Greg Ziółkowski
edd77c0791 Blocks: Add i18n support to register_block_type_from_metadata
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/23636.
Related WP-CLI PR: https://github.com/wp-cli/i18n-command/pull/210.
Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented

Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field.


Props swissspidy, ocean90.
Fixes #52301.



git-svn-id: https://develop.svn.wordpress.org/trunk@49981 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-19 11:04:03 +00:00