Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#24733 closed defect (bug) (fixed)

Unused code in WP_Widgets::update_callback()

Reported by: jdgrimes Owned by: SergeyBiryukov
Milestone: 3.9 Priority: normal
Severity: minor Version:
Component: Widgets Keywords: good-first-bug has-patch
Focuses: Cc:


The single argument for WP_Widgets::update_callback() ($widget_args) does not appear to have any usage in the function, except for the five references shown below, which alone don't seem to do anything.

if ( is_numeric($widget_args) )
       $widget_args = array( 'number' => $widget_args );
       $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );

Attachments (1)

24733.diff (768 bytes) - added by OriginalEXE 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ocean90
7 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.9

Hello jdgrimes, thanks for the report.

Yes, the code seems to be unused since it was introduced in [10798]. How bad.

#2 @SergeyBiryukov
7 years ago

The original code was introduced in [10764]. $widget_args was used in control_callback().

In [10798], control_callback() was renamed to update_callback(), and $widget_args usage was moved to form_callback().

So, yeah, unused since [10798].

#3 @SergeyBiryukov
7 years ago

  • Keywords good-first-bug added

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.

7 years ago

7 years ago

#5 @OriginalEXE
7 years ago

  • Keywords has-patch added; needs-patch removed

#6 @SergeyBiryukov
7 years ago

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

In 27224:

Remove unused code from WP_Widget::update_callback().

props OriginalEXE.
fixes #24733.

Note: See TracTickets for help on using tickets.