From 2f4ffff0fbf64ac043dddadcd3f73b2c1ffa9c0d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 20 Nov 2023 00:08:25 +0000 Subject: [PATCH] Administration: Standardize default values in `submit_button()`. This commit updates the `submit_button()` function to standardize the default values of `$text` and `$other_attributes` parameters. Previously set to `null`, these defaults have now been changed to an empty string (`''`), bringing consistency with the `get_submit_button()` function, which `submit_button()` wraps. The change maintains backward compatibility, as `get_submit_button()` does not perform strict type-checking on these parameters. This update aligns with the ongoing effort to standardize function parameters across the WordPress codebase, improving the readability and predictability of the core functions. Follow-up to [31446]. Props andbalashov. Fixes #59921. Built from https://develop.svn.wordpress.org/trunk@57128 git-svn-id: http://core.svn.wordpress.org/trunk@56639 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index e667400f33..6b4a50752e 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2553,9 +2553,9 @@ function compression_test() { * These key/value attribute pairs will be output as `attribute="value"`, * where attribute is the key. Attributes can also be provided as a string, * e.g. `id="search-submit"`, though the array format is generally preferred. - * Default null. + * Default empty string. */ -function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) { +function submit_button( $text = '', $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = '' ) { echo get_submit_button( $text, $type, $name, $wrap, $other_attributes ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 256c3a4637..b8e501bd07 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57127'; +$wp_version = '6.5-alpha-57128'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.