Commit Graph

4117 Commits

Author SHA1 Message Date
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
Greg Ziółkowski
987acb5954 Editor: Fix failing unit test for i18n support in theme.json
As part of the change, I also did some code reorganization to match with how other test fixtures are handled.

Follow-up [50959].

See #52991.



git-svn-id: https://develop.svn.wordpress.org/trunk@50960 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 09:49:48 +00:00
Riad Benguella
ef3da3363a Block Editor: Add Global Settings support using theme.json file.
This is the first piece of landing the theme.json processing in WordPress core. 
It allows themes to configure the different editor settings, allow cusomizations and define presets in theme.json file.
 
Props jorgefilipecosta, nosolosw.
See #53175.


git-svn-id: https://develop.svn.wordpress.org/trunk@50959 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 08:36:11 +00:00
Riad Benguella
c0084bccca General: Add _wp_array_set function.
This adds the _wp_array_set function, which is the counterpart of the existing _wp_array_get.
This utility is to be used by the Global Settings work.

Props nosolosw, jorgefilipecosta.
See #53175.


git-svn-id: https://develop.svn.wordpress.org/trunk@50958 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 08:29:03 +00:00
Greg Ziółkowski
2a389ad7b7 Editor: Extract block_editor_rest_api_preload method for use with different editor screens
It is going to be used on the new widgets editor screen. This patch also introduced a new class WP_Block_Editor_Context that is going to be used with revised block editor filters to let extenders to keep their existing behavior. It should also allow to provide more settings through the context class as new screens get introduced like the navigation editor.

Props azaozz, chrisvanpatten, timothyblynjacobs, youknowriad.
Fixes #52920.




git-svn-id: https://develop.svn.wordpress.org/trunk@50956 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 07:31:49 +00:00
Greg Ziółkowski
b9b464de8a Editor: Add missing unit tests for block_has_support
Follow-up for [50761].
Props ntsekouras.
Fixes #53257. See #52991.



git-svn-id: https://develop.svn.wordpress.org/trunk@50955 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 06:26:00 +00:00
Peter Wilson
7cd5ecd667 XML-RPC: Set HTTP status code in accordance with the spec.
When the XML-RPC endpoint is enabled, always return a HTTP `200 OK` status code in accordance with the XML-RPC specification. Continue to return an HTTP `405 Method Not Allowed` status code when the endpoint is disabled.

Props ariskataoka, johnbillion.
Fixes #52958.



git-svn-id: https://develop.svn.wordpress.org/trunk@50954 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-24 02:17:36 +00:00
Sergey Biryukov
c4fd562663 Widgets: Make sure WP_Widget constructor creates a correct id_base value for a namespaced widget class.
The `id_base` value is used for the widget's `id` and `class` attributes and also for the option name which stores the widget settings (unless the widget specifies a custom `option_name` value).

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

This also avoids a `preg_match(): Compilation failed` PHP warning from `next_widget_id_number()` on the Widgets screen, previously caused by unescaped backslashes.

Props Mte90, hermpheus, rogerlos, welcher, SergeyBiryukov.
Fixes #44098.

git-svn-id: https://develop.svn.wordpress.org/trunk@50953 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-23 08:50:44 +00:00
Sergey Biryukov
655fbb26ab Media: Some documentation and test improvements for the image_editor_output_format filter:
* Update the filter DocBlock per the documentation standards.
* Use a shorter variable name for consistency with the surrounding code.
* Delete the test file before performing assertions to avoid leftovers in case the test fails.

Follow-up to [50943].

See #52867.

git-svn-id: https://develop.svn.wordpress.org/trunk@50951 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-22 12:58:46 +00:00
Adam Silverstein
62327715a0 Revisions: add a new filter for revisions to keep by post type.
Add a new `wp_{$post_type}_revisions_to_keep` filter that makes it convenient to filter the number of revisions created for a specific post type.

Overrides both the value of WP_POST_REVISIONS and the `wp_revisions_to_keep` filter.

Props dlh.
Fixes #51550.



git-svn-id: https://develop.svn.wordpress.org/trunk@50949 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-21 15:28:39 +00:00
Riad Benguella
83c5f4d23b Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC.
This also includes:

 - The removal of the Post Author block.
 - Renaming build_query_vars_from_query_block function.
 - Update the block supports.

Props gziolo.
See #52991. 
-This line, and those below, will be ignored--

M    package-lock.json
M    package.json
M    src/wp-includes/assets/script-loader-packages.php
M    src/wp-includes/block-supports/colors.php
AM   src/wp-includes/block-supports/elements.php
D    src/wp-includes/block-supports/padding.php
AM   src/wp-includes/block-supports/spacing.php
M    src/wp-includes/block-supports/typography.php
M    src/wp-includes/blocks/column/block.json
M    src/wp-includes/blocks/index.php
D    src/wp-includes/blocks/post-author
D    src/wp-includes/blocks/post-author.php
M    src/wp-includes/blocks/post-content.php
M    src/wp-includes/blocks/post-featured-image.php
M    src/wp-includes/blocks/query/block.json
M    src/wp-includes/blocks/query-loop/block.json
M    src/wp-includes/blocks/query-loop.php
M    src/wp-includes/blocks/query-pagination/block.json
M    src/wp-includes/blocks/query-pagination-next.php
M    src/wp-includes/blocks/query-pagination-numbers.php
M    src/wp-includes/blocks/site-tagline/block.json
M    src/wp-includes/blocks/site-title/block.json
M    src/wp-includes/blocks.php
M    src/wp-settings.php
M    tests/phpunit/tests/blocks/block.php
M    tools/webpack/packages.js


git-svn-id: https://develop.svn.wordpress.org/trunk@50945 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-21 10:12:42 +00:00
Greg Ziółkowski
e7dbf1d5f1 Editor: Add missing unit tests for construct_wp_query_args
Follow-up for [50929].
Props ntsekouras, jorbin.
Fixes #53240. See #52991.



git-svn-id: https://develop.svn.wordpress.org/trunk@50944 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-21 06:28:59 +00:00
Anthony Burchell
5a2c3706ee Media: Introduces image_editor_output_format filter for setting default MIME type of sub size image output.
This change introduces the `image_editor_output_format` filter, which fires as sub size images are generated allowing to define a default image MIME type for those items.

Props adamsilverstein, williampatton, spacedmonkey, mikeschroder, hellofromTonya, justinahinon, Boniu91, antpb, SergeyBiryukov.
Fixes #52867.



git-svn-id: https://develop.svn.wordpress.org/trunk@50943 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-20 22:14:47 +00:00
Sergey Biryukov
3da0ccdc95 General: Ensure consistent type for integer properties of a bookmark object.
Previously, these properties could be unexpectedly converted to strings in some contexts.

This applies to the following function:

* `sanitize_bookmark_field()`

and the following properties:

* `$bookmark::link_id`
* `$bookmark::link_rating`

Follow-up to [50935].

See #53235.

git-svn-id: https://develop.svn.wordpress.org/trunk@50936 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-20 00:03:04 +00:00
Sergey Biryukov
110f132f7e General: Ensure consistent type for integer properties of WP_Post, WP_Term, and WP_User.
Previously, these properties could be unexpectedly converted to strings in some contexts.

This applies to the following functions:

* `sanitize_post_field()`
* `sanitize_term_field()`
* `sanitize_user_field()`

and the following properties:

* `WP_Post::ID`
* `WP_Post::post_parent`
* `WP_Post::menu_order`
* `WP_Term::term_id`
* `WP_Term::term_taxonomy_id`
* `WP_Term::parent`
* `WP_Term::count`
* `WP_Term::term_group`
* `WP_User::ID`

Props grantmkin, SergeyBiryukov.
Fixes #53235. See #52995.

git-svn-id: https://develop.svn.wordpress.org/trunk@50935 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-19 22:10:58 +00:00
Jonathan Desrosiers
2207c248f0 Script Loader: Stop loading polyfills specific to Internet Explorer
This change removes the inline JavaScript attached to the `wp-polyfill` script responsible for loading polyfill libraries included specifically for Internet Explorer support.

Support for the final version of IE supported in WordPress Core (IE11) was removed in [50784] and will on longer be supported when the next version of WordPress is released.

These scripts are still registered and available to be enqueued, but WordPress will no longer load them by default.

For more information, see https://wordpress.org/news/2021/05/dropping-support-for-internet-explorer-11/.

Props youknowriad, gziolo, sergiomdgomes, desrosj.
Fixes #53078.

git-svn-id: https://develop.svn.wordpress.org/trunk@50934 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-19 19:59:55 +00:00
Greg Ziółkowski
585f62ad8c Editor: Update WordPress packages published for Gutenberg 10.6
It contains several changes in addition to regular update to WordPress packages:
- All newly exposed blocks are now registered on the server.
- Dutone block support was added.
- Border block support was updated.
- New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work.

Props youknowriad.
See #52991.




git-svn-id: https://develop.svn.wordpress.org/trunk@50929 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-19 15:07:55 +00:00
Greg Ziółkowski
6ad4e34c54 Editor: Extend register_block_type to accept the path file or folder with block.json
Rather than using two distinct methods to register block types in WordPress core, let's make `register_block_type` the canonical method to deal with all use cases. In practice, the patch proposed extends its usage to work as a proxy to `register_block_type_from_metadata`. It should remove some confusion that we observed and let us be more explicit what's the latest recommendation.

Props matveb, mcsf.
Fixes #53233.



git-svn-id: https://develop.svn.wordpress.org/trunk@50927 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-19 13:50:09 +00:00
Sergey Biryukov
fe9ab38075 Tests: Use assertInstanceOf() instead of assertTrue() in some tests.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50926 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-18 21:04:31 +00:00
Sergey Biryukov
8e498a8314 KSES: Allow calc() and var() values to be used in inline CSS.
Props aristath, displaynone, joyously, olafklejnstrupjensen, sabernhardt, jamesbonham, poena.
Fixes #46197, #46498.

git-svn-id: https://develop.svn.wordpress.org/trunk@50923 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-17 21:03:56 +00:00
Greg Ziółkowski
0b6eb8daba Editor: Remove editor type specific filters for block editor configuration
Aligns with changes introduced in the Gutenberg plugin. The planned follow-up replace the editor name string with a context object to bring back an optional reference to the actual post.

Props youknowriad.
See #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50920 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-17 15:06:27 +00:00
Greg Ziółkowski
d9f169a02a Editor: Rename should_load_separate_core_block_assets for consistency
Changes introduced:
- The `wp_should_load_separate_core_block_assets` function.
- The `should_load_separate_core_block_assets` filter.

Props hellofromTonya, SergeyBiryukov.
Fixes #50328.



git-svn-id: https://develop.svn.wordpress.org/trunk@50919 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-17 14:26:53 +00:00
Sergey Biryukov
32151af6e4 Docs: Miscellaneous DocBlock corrections.
See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50916 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-15 17:36:49 +00:00
Sergey Biryukov
6768039f21 Docs: Update documentation in phpunit/includes/abstract-testcase.php per the documentation standards.
Follow-up to [44902].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50913 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-14 19:07:47 +00:00
Sergey Biryukov
bab911f0d7 Editor: Some documentation and test improvements for loading separate assets for core blocks:
* Move `should_load_separate_core_block_assets()` to a more appropriate place.
* Update DocBlocks and inline comments per the documentation standards.
* Document the `$wp_styles` global in `wp_maybe_inline_styles()`.
* List the expected result first in unit test assertions.
* Remove a duplicate unit test.
* Add missing `@covers` tags.

Follow-up to [50836], [50837].

See #50328, #52620, #53180.

git-svn-id: https://develop.svn.wordpress.org/trunk@50838 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-11 16:26:28 +00:00
Greg Ziółkowski
d5f900c3df Editor: Enqueue script and style assets only for blocks present on the page
Adds styles for individual core blocks to make it possible to render only styles for those blocks that are rendered on the page (frontend). This is optinal functionality for start that can be controlled with the new `separate_core_block_assets` filter.

In addition to that, styles can be inlined when `path` is passed when registering an individual styles. This functionality can be changed with the new `styles_inline_size_limit` filter. The maximum size of inlined styles in bytes defaults to 20 000.

Props aristath, aduth, westonruter, mcsf.
Fixes #50328, #52620.



git-svn-id: https://develop.svn.wordpress.org/trunk@50836 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-11 09:41:48 +00:00
Jonathan Desrosiers
2ac7f39570 Posts, Post Types: Enable revisions for the wp_block post type.
This allows site owners to take advantage of revisions while broader improvements to block management and reusable blocks are explored.

Props matveb, audrasjb, desrosj.
Fixes #53072.

git-svn-id: https://develop.svn.wordpress.org/trunk@50835 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-10 18:37:36 +00:00
Greg Ziółkowski
154c0800e3 Editor: Update WordPress packages from Gutenberg 10.5
Applies changes between the Gutenberg plugin v10.4 and v10.5. It contains the latest version of WordPress packages and PHP changes applied to non-experimental features.

Props youknowriad.
See #52991.



git-svn-id: https://develop.svn.wordpress.org/trunk@50824 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-07 11:46:32 +00:00
Sergey Biryukov
462560edba Media: Some documentation and test improvements for WebP support:
* Document that WebP constants are only defined in PHP 7.1+.
* Correct the `$filename` parameter type in `wp_get_webp_info()`.
* Use a consistent message when skipping tests due to the lack of WebP support.
* Remove unnecessary `else` branches after `markTestSkipped()`.
* Replace `assertEquals()` with more appropriate assertions.

Follow-up to [50810].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50814 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 17:06:17 +00:00
Jonathan Desrosiers
aa62fdbfaa Formatting: Verify emails with + characters are valid.
This adds an assertion to confirm that `is_email()` considers email addresses with a `+` valid.

Props SergeyBiryukov, ayeshrajans.
Fixes #53130.

git-svn-id: https://develop.svn.wordpress.org/trunk@50812 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 16:05:49 +00:00
Adam Silverstein
6a5ff5aa03 Images: enable WebP support.
Add support for uploading, editing and saving WebP images when supported by the server.

Add 'image/webp' to supported mime types. Correctly identify WebP images and sizes even when PHP doesn't support WebP. Resize uploaded WebP files (when supported) and use for front end markup.

Props markoheijne, blobfolio, Clorith, joemcgill, atjn, desrosj, spacedmonkey, marylauc, mikeschroder, hellofromtonya, flixos90.
Fixes #35725.



git-svn-id: https://develop.svn.wordpress.org/trunk@50810 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 14:43:36 +00:00
Sergey Biryukov
30ff995eb0 REST API: Check the results of get_metadata() in WP_REST_Meta_Fields methods.
This avoids PHP warnings in case the function returns boolean `false` instead of an array.

Props david.binda.
Fixes #53099.

git-svn-id: https://develop.svn.wordpress.org/trunk@50793 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-27 18:34:52 +00:00
Peter Wilson
ecd93af74a Users: Share current user instance across functions.
Share the `WP_User` instance for the current user between the functions `get_userdata()` and `wp_get_current_user()`. Both functions return the `$current_user` global for the current user.

Force refresh the `$current_user` global within `clean_user_cache()` by immediately re-calling `wp_set_current_user()` with the current user's ID. This ensures any changes to the current user's permissions or other settings are reflected in the global. As a side-effect this immediately rewarms the current user's cache.

Props chaion07, chriscct7, donmhico, hellofromtonya, lukecarbis, peterwilsoncc, rmccue, TimothyBlynJacobs.
Fixes #28020.


git-svn-id: https://develop.svn.wordpress.org/trunk@50790 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-26 01:02:34 +00:00
Peter Wilson
c44e1d6fe4 Build/Tests tools: Improve get_bookmark() test coverage.
Props hellofromtonya, peterwilsoncc.
See #52988.


git-svn-id: https://develop.svn.wordpress.org/trunk@50789 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-26 00:58:14 +00:00
Greg Ziółkowski
4ac39957a2 Editor: Shape block editor filters to work better with the Gutenberg plugin
This should allow to use new filters in the Gutenberg plugin and therefore it prevents deprecation warnings when in the debug mode.

See #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50777 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 09:30:40 +00:00
Greg Ziółkowski
a19f589a5f Editor: Abstract block editor configuration
There are several WordPress hooks defined on the server that depend on $post object that isn’t present on the new screens like edit site, edit widgets, or edit navigation. This patch deprecates existing filters and introduces replacements that are context-aware.

Props azaozz, andraganescu, jeremyfelt, nosolosw, youknowriad.
See #52920.





git-svn-id: https://develop.svn.wordpress.org/trunk@50776 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 05:10:56 +00:00
Peter Wilson
38652cf33e Build/Test Tools: Add seeking support to stream test library.
Introduces seeking to the `WP_Test_Stream` stream wrapper. This allows the testing of `wp_getimagesize()` and `wp_read_image_metadata()` among others. Includes tests for the latter.

Props hellofromTonya.
Fixes #52922.
See #52826.


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