mirror of
https://github.com/WordPress/WordPress.git
synced 2026-06-19 07:37:07 +00:00
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:
@@ -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();
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user