WordPress/wp-includes/rest-api/endpoints
Sergey Biryukov 8a4deae8f8 REST API: Correct image cropping tools in the block editor.
As of [58457], the width and height cropping values are cast to an integer before the comparison to see if the target width and height differ from the original width and height.

Since they are now integers, it exposes a bug where the `&&` of the `if` conditional meant that if you were only cropping in one dimension, the check wouldn't pass, and cropping would not occur.

In the block editor, the cropping tools are aspect ratio based, so one of the dimensions will always match that of the source image. Therefore, now that the values are cast as integers, the condition that allows a cropping to occur needs to be updated. If either width or height is different from the source image, then a crop should be allowed.

Follow-up to [50124], [58457].

Props andrewserong, jrf, kevin940726.
Fixes #61514. See #59782.
Built from https://develop.svn.wordpress.org/trunk@58612


git-svn-id: http://core.svn.wordpress.org/trunk@58045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-01 20:45:15 +00:00
..
class-wp-rest-application-passwords-controller.php
class-wp-rest-attachments-controller.php REST API: Correct image cropping tools in the block editor. 2024-07-01 20:45:15 +00:00
class-wp-rest-autosaves-controller.php
class-wp-rest-block-directory-controller.php
class-wp-rest-block-pattern-categories-controller.php
class-wp-rest-block-patterns-controller.php Coding Standards: Apply changes after running `composer format`. 2024-06-13 15:06:07 +00:00
class-wp-rest-block-renderer-controller.php
class-wp-rest-block-types-controller.php Coding standards: Apply some changes after `composer format`. 2024-03-05 06:55:08 +00:00
class-wp-rest-blocks-controller.php
class-wp-rest-comments-controller.php
class-wp-rest-controller.php
class-wp-rest-edit-site-export-controller.php
class-wp-rest-font-collections-controller.php
class-wp-rest-font-faces-controller.php Editor (Font Library): Store font subdirectory in post meta. 2024-06-05 23:19:17 +00:00
class-wp-rest-font-families-controller.php Editor: Add theme.json v3 migrations. 2024-06-04 11:55:14 +00:00
class-wp-rest-global-styles-controller.php Section styles: improve performance and conceptual consistency. 2024-06-24 08:51:16 +00:00
class-wp-rest-global-styles-revisions-controller.php Block Themes: Add support for relative URLs in top-level theme.json styles 2024-05-31 01:19:14 +00:00
class-wp-rest-menu-items-controller.php
class-wp-rest-menu-locations-controller.php
class-wp-rest-menus-controller.php
class-wp-rest-navigation-fallback-controller.php
class-wp-rest-pattern-directory-controller.php
class-wp-rest-plugins-controller.php
class-wp-rest-post-statuses-controller.php
class-wp-rest-post-types-controller.php REST API: Add template and template_lock to post types endpoint. 2024-06-21 13:06:12 +00:00
class-wp-rest-posts-controller.php REST API: Add post class list field. 2024-06-04 10:23:15 +00:00
class-wp-rest-revisions-controller.php
class-wp-rest-search-controller.php REST API: Prevent error when passing invalid `type` parameter to search endpoint. 2024-03-15 11:25:06 +00:00
class-wp-rest-settings-controller.php Options: Add 'label' argument to register_setting. 2024-05-29 08:53:09 +00:00
class-wp-rest-sidebars-controller.php
class-wp-rest-site-health-controller.php
class-wp-rest-taxonomies-controller.php
class-wp-rest-template-autosaves-controller.php
class-wp-rest-template-revisions-controller.php Docs: Improve docblock for `WP_REST_Template_Revisions_Controller::get_parent()`. 2024-05-15 11:18:12 +00:00
class-wp-rest-templates-controller.php Editor: resolve patterns server side. 2024-06-03 18:32:14 +00:00
class-wp-rest-terms-controller.php
class-wp-rest-themes-controller.php Coding Standards: Apply changes after running `composer format`. 2024-06-13 15:06:07 +00:00
class-wp-rest-url-details-controller.php
class-wp-rest-users-controller.php Coding Standards: Apply changes after running `composer format`. 2024-06-13 15:06:07 +00:00
class-wp-rest-widget-types-controller.php
class-wp-rest-widgets-controller.php