Make WordPress Core

Opened 10 years ago

Last modified 8 months ago

#27747 new defect (bug)

Inconsistent type default between `submit_button()` and `get_submit_button()`

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5
Component: Administration Keywords: has-patch dev-feedback
Focuses: administration, template Cc:

Description

One defaults to $type = 'primary' while the other defaults to $type = 'primary large'.

Shouldn't that last one be $type = 'primary' too?

Attachments (1)

template.diff (753 bytes) - added by OriginalEXE 10 years ago.
Changed default $type parameter value for get_submit_button

Download all attachments as: .zip

Change History (7)

#1 @UmeshSingla
10 years ago

  • Version changed from 3.8.2 to 3.5

#2 @SergeyBiryukov
10 years ago

Introduced in [22099].

@OriginalEXE
10 years ago

Changed default $type parameter value for get_submit_button

#3 @OriginalEXE
10 years ago

  • Keywords has-patch 2nd-opinion added

Patch attached,

I checked the usage of get_submit_button function throughout the WP code and $type parameter is specified in each, so this change would not affect the WP admin.

The only side effect of this change is that button class would change in plugins/themes that count on 'primary large' to be a default, but I would say consistency between functions is more important.

#4 @chriscct7
9 years ago

  • Keywords dev-feedback added; 2nd-opinion removed

#5 follow-up: @Mte90
8 years ago

As you can see on https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/template.php#L1906 that patch already exist (https://core.trac.wordpress.org/ticket/27747#comment:2) in the last version of wordpress.

I think that ticket can be closed.

#6 in reply to: ↑ 5 @SergeyBiryukov
8 months ago

  • Milestone set to Awaiting Review

Replying to Mte90:

As you can see on https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/template.php#L1906 that patch already exist (https://core.trac.wordpress.org/ticket/27747#comment:2) in the last version of wordpress.

No, $type still defaults to 'primary' in submit_button() and 'primary large' in get_submit_button().

The ticket is still valid.

Note: See TracTickets for help on using tickets.