4153 Commits

Author SHA1 Message Date
Sergey Biryukov
d4b2fae838 Tests: Use assertSameSets() in some newly introduced tests.
This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [49925], [50157], [50959], [50960], [50995], [51079].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51137 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-10 19:18:15 +00:00
Peter Wilson
5bee644258 Widgets: Improve unit tests for RSS Widget.
Prevent unit tests from making HTTP requests to wordpress.org. Specify URLs as https rather than http.

Follow up to [51107].

Props hellofromTonya.
Fixes #53278.


git-svn-id: https://develop.svn.wordpress.org/trunk@51136 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 23:50:14 +00:00
Sergey Biryukov
81e84e12e8 Tests: Ignore EOL differences in some tests using multiline string assertions.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

Follow-up to [48466], [50995], [51079].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51135 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 19:41:47 +00:00
Jonathan Desrosiers
c83d315d52 Build/Test Tools: Silence jQuery Migrate console warnings when running E2E tests.
These warnings will still be visible in the browser console. The majority of the warnings are coming from jQuery UI, which is still waiting for a new update to be released that is jQuery >= 3.0 friendly.

This change makes the E2E test results more readable without having to tread through the large number of warnings.

Props isabel_brison.
Fixes #52860.

git-svn-id: https://develop.svn.wordpress.org/trunk@51130 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 01:35:26 +00:00
Anthony Burchell
1c418298bf Privacy: Improve naming of user confimed action email filters.
The filters `user_confirmed_action_email_content`, `user_erasure_complete_email_subject`, and `user_erasure_complete_email_headers` have been deprecated.

They have been replaced with `user_erasure_fulfillment_email_content`, `user_erasure_fulfillment_email_subject`, and `user_erasure_fulfillment_email_headers`.

Props desrosj, garrett-eclipse, birgire, DrewAPicture, lifeforceinst, ocean90, pbiron, pento, coffee2code, TZ-Media, SergeyBiryukov, johnbillion, audrasjb, davidbaumwald, hellofromTonya, helen, xkon, antpb, peterwilsoncc, lukecarbis.
Fixes #44314.



git-svn-id: https://develop.svn.wordpress.org/trunk@51129 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 01:34:09 +00:00
Jonathan Desrosiers
a2969fb07f Tests: Introduce some E2E tests for the Quick Draft dashboard widget.
Props isabel_brison, johnbillion.
Fixes #523905.

git-svn-id: https://develop.svn.wordpress.org/trunk@51128 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-09 00:19:25 +00:00
Jake Spurlock
d56d4afd02 Permalinks: Revert the changes stemming from pagination limits.
In [51118], an attempt was made to add pagination limits. The added tests need to be updated to ensure that they pass with the new changes.

Reverts [51118].

See #50233.


git-svn-id: https://develop.svn.wordpress.org/trunk@51125 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:31:46 +00:00
Jake Spurlock
1eb777209d Revisions: Check and return errors for insertions to revisions.
Fixes #30009.

Props rmccue, adamsilverstein, coreymckrill, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@51124 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:23:12 +00:00
Jake Spurlock
38232f655d Media: Add new functions to return the previous/next attachment links.
New functions:

* get_adjacent_image_link()
* get_next_image_link()
* get_previous_image_link()

Fixes #45708.

Props flixos90, DrewAPicture, mor10, antpb, hellofromTonya, whyisjake.




git-svn-id: https://develop.svn.wordpress.org/trunk@51122 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 23:12:22 +00:00
Anthony Burchell
c2313c6934 Feeds: Avoid notices in get_post_comments_feed_link().
When an feed request is made to a non-existent page, surpress the notice.

Props dd32, SergeyBiryukov, mukesh27, hellofromTonya.
Fixes #52814.



git-svn-id: https://develop.svn.wordpress.org/trunk@51121 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:59:19 +00:00
Jake Spurlock
346e47b176 Permalinks: Limit pagination for posts with comments.
Additionally, redirect pages back to the source page if comments don't exist.

Props devrekli, carike, sumanm, mukesh27, chaion07, audrasjb, whyisjake, SergeyBiryukov.

Fixes #50233.


git-svn-id: https://develop.svn.wordpress.org/trunk@51118 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:49:27 +00:00
Jonathan Desrosiers
f64478d67c Emoji: Update the Twemoji library to version 13.1.0.
This version introduces support for the latest Emoji added in version Emoji 13.1, which includes “face in clouds”, “face exhaling”, and of course, “face with spiral eyes”.

A new corresponding folder has been pushed to WordPress.org in [dotorg:17419].

Rages deep within, ❤️‍🔥.

Props kraftbj., desrosj.
Fixes #52852.

git-svn-id: https://develop.svn.wordpress.org/trunk@51113 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 22:13:27 +00:00
Riad Benguella
0d4bdbf835 Block Editor: Include the page list block server-side code.
On a previous package update, this block's server-side code has been missed.
This was causing the block to not render properly.

Props Chouby, desrosj, mcsf.
Fixes #53309.


git-svn-id: https://develop.svn.wordpress.org/trunk@51105 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 18:11:31 +00:00
Riad Benguella
9ae2587b76 Block Editor: Package updates for WordPress 5.8 beta 1 (batch2).
This includes the following fixes:

 - Fix inspector opening when clicking outside the widget areas
 - Assume light theme when a transparent background is used
 - Make Post blocks non editable inside Query block
 - Rename QueryLoop to PostTemplate block

Props ntsekouras.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51101 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 17:31:14 +00:00
Riad Benguella
611d953e15 Block Editor: Add the Site Logo block's server implementation.
Props aristath, timothyblynjacobs, ocean90.
Fixes #53247.


git-svn-id: https://develop.svn.wordpress.org/trunk@51091 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 08:26:23 +00:00
Riad Benguella
377c88d462 Block Editor: Package updates for 5.8 beta 1.
This includes the following fixes:


Widgets Editor:
  - Load widgets.php https://github.com/WordPress/gutenberg/pull/32299
 - Fix Legacy Widget Preview https://github.com/WordPress/gutenberg/pull/32300
 - Fix error when saving empty Legacy Widget block https://github.com/WordPress/gutenberg/pull/32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open https://github.com/WordPress/gutenberg/pull/32361
 - Display wide widgets as popovers https://github.com/WordPress/gutenberg/pull/31736

Global Styles:
 - Align classNames generation between client and server https://github.com/WordPress/gutenberg/pull/32352
 - Group typography block supports https://github.com/WordPress/gutenberg/pull/32252 https://github.com/WordPress/gutenberg/pull/32444 https://github.com/WordPress/gutenberg/pull/32459
 - Make theme.json syntax errors more visible to the users https://github.com/WordPress/gutenberg/pull/32404


Template Editor:
  - Update the appearance of the template details https://github.com/WordPress/gutenberg/pull/32042
  - Fix layout definition https://github.com/WordPress/gutenberg/pull/32425
  - Fix grouping post content block https://github.com/WordPress/gutenberg/pull/32453

Miscellaneous:
 - Prevent saving when the post is locked https://github.com/WordPress/gutenberg/pull/32341
 - Fix allowed block patterns selector https://github.com/WordPress/gutenberg/pull/32376
 - Fix wrong results in the Post Author picker https://github.com/WordPress/gutenberg/pull/32344
 - Fix notices position in top toolbar mode https://github.com/WordPress/gutenberg/pull/32238
 - Allow non-latin characters in post slugs https://github.com/WordPress/gutenberg/pull/32232
 - Fix Random collapse of the color settings panel https://github.com/WordPress/gutenberg/pull/32388
 - Fix theme logo theme mode not being removed on theme removal https://github.com/WordPress/gutenberg/pull/32370
 - Fix block alignment styles in the editor https://github.com/WordPress/gutenberg/pull/32454
 - Fix some block toolbar overlaps https://github.com/WordPress/gutenberg/pull/32424
 - Fix content loss when switching list types https://github.com/WordPress/gutenberg/pull/32432


Performance:
 - Improve the performance of buttons block https://github.com/WordPress/gutenberg/pull/32356
 - Improve the performance of the container blocks https://github.com/WordPress/gutenberg/pull/32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 08:07:15 +00:00
Robert Anderson
8add05ff15 Make new WordPress installations use blocks in widget areas instead of widgets
Modifies `wp_install_defaults()` so that when you install a new WordPress site you
have block in your widget areas, not widgets.

Fixes #53324.
Props isabel_brison, hellofromtonya, andraganescu.


git-svn-id: https://develop.svn.wordpress.org/trunk@51088 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-08 01:54:27 +00:00
Sergey Biryukov
37a4faa7ed Tests: Use assertSame() in some newly introduced tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [50380], [50959], [50960], [50973], [50993], [51003], [51051], [51054].

See #52482.

git-svn-id: https://develop.svn.wordpress.org/trunk@51079 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-07 11:16:29 +00:00
Robert Anderson
176da85be9 Fix failing block editor test
Removes the Meta and Nav Menu widgets from the set of widgets expected by the
test for get_default_block_editor_settings().

Follows [51067].
See #53301.


git-svn-id: https://develop.svn.wordpress.org/trunk@51069 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-04 05:25:31 +00:00
Robert Anderson
08d48b9e21 REST API: Fix delete widget endpoint
Makes the `DELETE /wp/v2/widgets/:id?force=1` endpoint actually delete the
widget from the `"widget-$id_base"` option and not just remove it from
`'sidebars_widgets'`.

Fixes #53313.
Props TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@51059 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-02 01:21:17 +00:00
Sergey Biryukov
f5ca52c617 Tests: Remove the ::append_to_selector() method from Tests_Theme_wpThemeJson.
The method exists in the `WP_Theme_JSON` class and appears to be erroneously duplicated in the test class.

Add a unit test that was meant to be included instead, as per https://github.com/WordPress/gutenberg/pull/32190.

Follow-up to [51051].

See #52991.

git-svn-id: https://develop.svn.wordpress.org/trunk@51054 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 11:30:05 +00:00
Riad Benguella
f166ac5b8f Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests.
In core, you can run `tests/gutenberg/run.js` script to run the Gutenberg e2e tests
against Core with the plugin being disabled. This test ensures that the integration
of the block editor with Core is working properly.

This commit updates the Gutenberg base branch to be used for the tests to be wp/trunk
which corresponds to the latest packages that are included in Core.

See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51052 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 09:21:36 +00:00
Riad Benguella
80957a6179 Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes:

- Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279
- Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063
- Template mode:
    - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057
    - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026
    - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076
    - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315
    - Update the title area https://github.com/WordPress/gutenberg/pull/32037 
- Widgets Screen:
    - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757
    - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991
    - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212
    - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262
    - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260
    - 
- Block Widgets in the customizer: 
    - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140
    - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072
    - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175
    - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259
    - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005
    - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 
- Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006
- Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 
- Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070
- Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102
- Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152
- Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159
- Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160
- Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190
- Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200
- Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229
- Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245
- Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266
- Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305
- Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343
- Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135

Props nosolosw, noisysocks.
See #52991.


git-svn-id: https://develop.svn.wordpress.org/trunk@51051 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-01 08:07:07 +00:00
Timothy Jacobs
8edfb80800 REST API: Remove duplicates in the widget types endpoint.
Props noisysocks, spacedmonkey, imath, isabel_brison.
Fixes #53305.


git-svn-id: https://develop.svn.wordpress.org/trunk@51049 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-31 20:56:22 +00:00
Peter Wilson
41513c2d0f REST API: Re-introduce WP_Test_REST_Widgets_Controller tests.
Returns the test suite with the addition of defining a URL in the RSS widget within `WP_Test_REST_Widgets_Controller::test_get_items()` to work around an infinite loop in `WP_Widget_RSS` on PHP 8 if the URL is unset or empty.

Reverts [51020].

Props peterwilsoncc, TimothyBlynJacobs.
See #41683.



git-svn-id: https://develop.svn.wordpress.org/trunk@51029 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 06:14:08 +00:00
Peter Wilson
55db8c73a3 Posts, Post Types: Improve post_exists() query.
Add `$status` parameter to `post_exists()` to allow developers to specify a post type, date and status to ensure they hit the `wp_posts` table's `type_status_date` index when determining if a post exists.

Props apokalyptik, boonebgorges, brettshumaker, DrewAPicture, MikeHansenMe, peterwilsoncc, whyisjake.
Fixes #34012.



git-svn-id: https://develop.svn.wordpress.org/trunk@51027 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 02:16:01 +00:00
Timothy Jacobs
852a2c216c REST API: Add support for modifying the term relation when querying posts.
By default, a post most contain any of the requested terms to be included in the response. This commit adds a new `operator` property that can be set to `AND` to require a post to contain all of the requested terms.

For example, `/wp/v2/posts?tags[terms]=1,2,3&tags[operator]=AND` will return posts that have tags with the ids of 1, 2, and 3.

Props dlh, earnjam, Clorith, jnylen0, sebbb.
Fixes #41287.


git-svn-id: https://develop.svn.wordpress.org/trunk@51026 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 02:15:51 +00:00
Kelly Choyce-Dwan
849c811396 Block Editor: Add support for the pattern directory.
Add an endpoint for fetching block patterns from WordPress.org, and load the block patterns from this new API. Remove the block patterns that have already been moved to WordPress.org/patterns.

Props ryelle, iandunn, youknowriad, timothyblynjacobs.
Fixes #53246.



git-svn-id: https://develop.svn.wordpress.org/trunk@51021 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 01:10:57 +00:00
Peter Wilson
6476ee7f78 REST API: Remove WP_Test_REST_Widgets_Controller tests.
This test suite is causing a loop in PHP8, remove tests to investigate.

Props SergeyBiryukov, desrosj.
See #41683.



git-svn-id: https://develop.svn.wordpress.org/trunk@51020 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-26 00:28:50 +00:00
Riad Benguella
ea49625d59 Block Editor: Introduce block templates for classic themes.
With this patch, users will be able to create custom block based templates
and assign them to specific pages/posts.

Themes can also opt-out of this feature

Props bernhard-reiter, carlomanf.
Fixes #53176.


git-svn-id: https://develop.svn.wordpress.org/trunk@51003 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 14:19:14 +00:00
Sergey Biryukov
645813bc57 Coding Standards: Move assignment out of condition in phpunit/includes/speed-trap-listener.php.
Follow-up to [45588] for `phpunit/includes/phpunit7/speed-trap-listener.php`.

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50998 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 11:54:28 +00:00
Robert Anderson
00bc227eb8 Adds the widgets block editor to widgets.php and customize.php
Moves the widgets block editor from Gutenberg into WordPress Core.

- Adds @wordpress/edit-widgets, @wordpress/customize-widgets and
  @wordpress/widgets.
- Modifies wp-admin/widgets.php to branch between the old editor and new editor
  depending on wp_use_widgets_block_editor().
- Modifies WP_Customize_Widgets to branch between the old editor control and new
  editor control depending on wp_use_widgets_block_editor().

Fixes #51506.
Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp.


git-svn-id: https://develop.svn.wordpress.org/trunk@50996 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 08:38:04 +00:00
Robert Anderson
bc48d7ae09 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs, spacedmonkey, zieladam, jorgefilipecosta, youknowriad, kevin940726.


git-svn-id: https://develop.svn.wordpress.org/trunk@50995 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 08:26:21 +00:00
Robert Anderson
1b05374ddd REST API: Revert widget endpoints
Reverts [50993] as it has missing props.

Reverts [50993].
See #41683.


git-svn-id: https://develop.svn.wordpress.org/trunk@50994 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 08:21:03 +00:00
Robert Anderson
909bd7fad0 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@50993 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 07:51:14 +00:00
Aaron Jorbin
84eee38fcb Formatting: Add 'main' tag to kses
`main` is a valid HTML element that is especially valuable for KSES to support in light of full site editing.

Related: https://github.com/WordPress/gutenberg/pull/28576 for the addition of `main` to the group block.

Fixes #53156.
Props glendaviesnz.



git-svn-id: https://develop.svn.wordpress.org/trunk@50987 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 01:42:20 +00:00
Sergey Biryukov
d80fdbca3b Tests: Minimize the chances of signature conflicts for assertEqualsWithDelta().
The PHPUnit 7.5+ method `assertEqualsWithDelta()` was polyfilled for PHPUnit < 7.5, but also overloaded for PHPUnit 7.5 itself, which was not necessary and created a higher chance of signature conflicts, especially when the WP test suite is used as a basis for integration tests with plugins/themes.

This change removes the unnecessary overloading for PHPUnit 7.5+ and simplifies the overloaded method for PHPUnit < 7.5, including removing the `IsEqual()` class alias declaration, no longer needed.

Follow-up to [48952].

Props jrf.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50986 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-25 01:07:43 +00:00
Greg Ziółkowski
b589f04a03 Editor: Use the block editor context in filters that used the editor name
Follow-up for [50956].
Props azaozz, chrisvanpatten, timothyblynjacobs, youknowriad.
Fixes #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50983 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 21:20:31 +00:00
Sergey Biryukov
479ea22b8e Tests: Improve PHPUnit version retrieval.
Always test for newer class names first and fall back to the older.

This improves compatibility when running PHPUnit via a phar while there is also a Composer-installed version of PHPUnit on the system.

Props jrf.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50982 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 21:03:15 +00:00
Jorge Costa
73bf1dab6b Block Editor: Update color merging algorithm.
The npm packages in use were published a few hours ago, which include some changes to how we manage colors. This commit adds the corresponding PHP changes.

Props nosolosw.
See #53175.

git-svn-id: https://develop.svn.wordpress.org/trunk@50977 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 18:56:09 +00:00
Jorge Costa
3d3aa3cd09 Block Editor: Add Global Styles support using theme.json file.
This is the second piece of landing the theme.json processing in WordPress core. 
It includes the mechanism that outputs the CSS styles of a theme.json file.

Props nosolosw, youknowriad.
See #53175.

git-svn-id: https://develop.svn.wordpress.org/trunk@50973 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 17:38:59 +00:00
Sergey Biryukov
1c4268756a Tests: Remove trailing commas in function calls in _wp_array_get() tests.
This fixes parse errors on PHP 7.2 and lower versions.

Follow-up to [49143], [49144], [49580], [50964].

See #51461, #51720, #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50970 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 13:46:39 +00:00
Sergey Biryukov
a5e333f03c Tests: Rename classes in phpunit/tests/privacy/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50969 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 13:37:56 +00:00
Sergey Biryukov
5ebaf70f7e Tests: Rename some classes in phpunit/tests/theme/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50968 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 13:31:15 +00:00
Sergey Biryukov
e4947e935d Docs: Some documentation and test improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:
* Add missing `@since` tags.
* Update some DocBlocks per the documentation standards.
* Rename test files and classes per the naming conventions.
* Fix some code alignment issues reported by WPCS.

Follow-up to [50959], [50960].

See #52991, #53175.

git-svn-id: https://develop.svn.wordpress.org/trunk@50967 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 13:24:05 +00:00
Sergey Biryukov
23e669465a Tests: Correct description for the Tests_Functions_wpArraySet class.
Follow-up to [50958], [50962], [50964], [50965].

See #53175, #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50966 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 12:27:35 +00:00
Sergey Biryukov
fa0fca4670 General: Some documentation and test improvements for the _wp_array_set():
* Update the function DocBlock per the documentation standards.
* Move the unit tests to a more appropriate place.
* Rename and reorder the tests for consistency with `_wp_array_get()` tests.

Follow-up to [50958], [50962], [50964].

See #53175, #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50965 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 12:24:14 +00:00
Sergey Biryukov
cea9485383 Tests: Add missing tests for the _wp_array_get() function.
Follow-up to [49143], [49144], [49580].

Props jorgefilipecosta, johnbillion.
See #51461, #51720, #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50964 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 11:06:15 +00:00
Greg Ziółkowski
451044d24d Editor: Rename the unit test file for _wp_array_set function
Follow-up [50958].
See #53175. 



git-svn-id: https://develop.svn.wordpress.org/trunk@50962 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 09:58:23 +00:00
Sergey Biryukov
2c7c677f25 Widgets: Make sure WP_Widget constructor creates a correct classname value for a namespaced widget class.
This reverts the changes to `id_base` from [50953] due to backward compatibility concerns, and instead focuses on the `id` and `class` attributes specifically.

With this change, any backslashes in the `id` or `class` attributes for a namespaced widget class are converted to underscores, making it easier to style the output or target the widget with JavaScript.

Follow-up to [50953].

Fixes #44098.

git-svn-id: https://develop.svn.wordpress.org/trunk@50961 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 09:50:30 +00:00