Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#9032 closed enhancement (fixed)

Two minor enhancements to checked() and selected()

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

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 18 years ago.
Patch
checked_sans_true.9032.diff​ (5.1 KB ) - added by filosofo 18 years ago.

Download all attachments as: .zip

Change History (7)

@johnbillion
18 years ago

Patch

#1 @johnbillion
18 years ago

  • Keywords has-patch added

Patchy

#2 @westi
18 years ago

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

#3 follow-up: @westi
18 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
18 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
18 years ago

  • Resolution → fixed
  • Status new → closed

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

Note: See TracTickets for help on using tickets.