Media: Make ::update_size() parameters consistent across image editors.

Includes:
* Standardizing default values on `null` vs. `false`.
* Updating the documentation to correct parameter types.
* Adding missing parameter descriptions.

Follow-up to [22094].

Props Soean, mukesh27, SergeyBiryukov.
See #64897.
Built from https://develop.svn.wordpress.org/trunk@62517


git-svn-id: http://core.svn.wordpress.org/trunk@61798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2026-06-17 11:35:41 +00:00
parent 7755215ff9
commit 94211f8455
4 changed files with 9 additions and 8 deletions
+3 -3
View File
@@ -144,11 +144,11 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
*
* @since 3.5.0
*
* @param int $width
* @param int $height
* @param int|null $width Image width.
* @param int|null $height Image height.
* @return true
*/
protected function update_size( $width = false, $height = false ) {
protected function update_size( $width = null, $height = null ) {
if ( ! $width ) {
$width = imagesx( $this->image );
}
@@ -247,12 +247,13 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
*
* @since 3.5.0
*
* @param int $width
* @param int $height
* @param int|null $width Image width.
* @param int|null $height Image height.
* @return true|WP_Error
*/
protected function update_size( $width = null, $height = null ) {
$size = null;
if ( ! $width || ! $height ) {
try {
$size = $this->image->getImageGeometry();
+2 -2
View File
@@ -201,8 +201,8 @@ abstract class WP_Image_Editor {
*
* @since 3.5.0
*
* @param int $width
* @param int $height
* @param int|null $width Image width.
* @param int|null $height Image height.
* @return true
*/
protected function update_size( $width = null, $height = null ) {
+1 -1
View File
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.1-alpha-62516';
$wp_version = '7.1-alpha-62517';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.