Skip to content

Commit

Permalink
Administration: Standardize default values in submit_button().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SergeyBiryukov committed Nov 20, 2023
1 parent 2a0d8fc commit 30954f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 30954f7

Please sign in to comment.