From 30954f7ac0840cfdad464928021d7f380940c347 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 20 Nov 2023 00:06:08 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@57128 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index e667400f33..6b4a50752e 100644 --- a/src/wp-admin/includes/template.php +++ b/src/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 ); }