From c66901ed13786083e86a702ccfc493af98caff4c Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 9 Sep 2026 21:57:03 +0530 Subject: [PATCH] Refactor editor height validation using clamp function --- src/wp-includes/class-wp-editor.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index d8616b4573e87..3d27222f00bc1 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -135,11 +135,7 @@ public static function parse_settings( $editor_id, $settings ) { } } - if ( $set['editor_height'] < 50 ) { - $set['editor_height'] = 50; - } elseif ( $set['editor_height'] > 5000 ) { - $set['editor_height'] = 5000; - } + $set['editor_height'] = clamp( $set['editor_height'], 50, 5000 ); return $set; }