WordPress.org

Make WordPress Core

#21451 closed enhancement (fixed)

Default Widgets don't all use selected() consistently

Reported by: iamfriendly Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: trivial Version: 3.4.1
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

I was looking through the default widgets /wp-includes/default-widgets.php to see how certain things were achieved (w.r.t menus) and noticed that on 3 of the default widgets the selected() function wasn't used.

Could well be reasons for this, but I couldn't spot anything obvious, so thought I'd write a very quick patch for that (attached).

It couldn't be any more minor, but thought I'd point it out anyway.

Attachments (2)

default-widgets-use-selected.diff (1.5 KB) - added by iamfriendly 21 months ago.
Patch for use of selected() in default widgets
21451.patch (1.6 KB) - added by SergeyBiryukov 21 months ago.

Download all attachments as: .zip

Change History (7)

iamfriendly21 months ago

Patch for use of selected() in default widgets

comment:1 iamfriendly21 months ago

As an aside, I've not produced a diff before, so I've probably got that entirely wrong. I tried to follow the instructions from the handbook and from Mark's guide, so if I've done something wrong on that front I apologise and would appreciate a point in the right direction.

SergeyBiryukov21 months ago

comment:2 SergeyBiryukov21 months ago

  • Milestone changed from Awaiting Review to 3.5

Thanks for the patch, it looks proper. Some edits in 21451.patch:

  • Added false as a third parameter (since the result should be concatenated rather than printed directly).
  • Reformatted the last block for consistency with the first one.
  • Adjusted spaces as per the coding standards.

comment:3 iamfriendly21 months ago

Ah, nice catches Sergey. I clearly need more coffee before submitting core patches (well, diffs). If I spot any more trivialities, I'll be sure to tidy them up.

Thanks again

Last edited 21 months ago by iamfriendly (previous) (diff)

comment:4 ocean9021 months ago

  • Summary changed from (minor)Default Widgets don't all use selected() consistently to Default Widgets don't all use selected() consistently

comment:5 nacin19 months ago

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

In [21867]:

Use selected() in default widgets. props SergeyBiryukov, iamfriendly. fixes #21451.

Note: See TracTickets for help on using tickets.