Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#9032 closed enhancement (fixed)

Two minor enhancements to checked() and selected()

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 2.8 Priority: low
Severity: trivial Version: 2.7
Component: Template Keywords: has-patch
Focuses: Cc:

Description

The helper functions checked() and selected() compare two passed parameters and echo out their respective markup based on the result of the comparison.

Two improvements would be to give the second parameter a default value of true and to add an echo parameter, also with default value of true.

Attachments (2)

9032.patch (940 bytes) - added by johnbillion 16 years ago.
Patch
checked_sans_true.9032.diff (5.1 KB) - added by filosofo 16 years ago.

Download all attachments as: .zip

Change History (7)

@johnbillion
16 years ago

Patch

#1 @johnbillion
16 years ago

  • Keywords has-patch added

Patchy

#2 @westi
16 years ago

(In [10662]) Enhance checked and selected as well as consolidating code. See #9032 props johnbillion for the idea.

#3 follow-up: @westi
16 years ago

  • Cc westi added

Now we need a mega patch to rid ourselves of calling with true as the second argument ;-)

#4 in reply to: ↑ 3 @filosofo
16 years ago

Replying to westi:

Now we need a mega patch to rid ourselves of calling with true as the second argument ;-)

There you go, thanks to sed. Not too mega, either.

#5 @westi
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10670]) Don't pass defaulted argument to checked(). Fixes #9032 props filosofo.

Note: See TracTickets for help on using tickets.