Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24733 closed defect (bug) (fixed)

Unused code in WP_Widgets::update_callback()

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

Description

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 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ocean90
11 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
11 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
11 years ago

  • Keywords good-first-bug added

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


11 years ago

@OriginalEXE
11 years ago

#5 @OriginalEXE
11 years ago

  • Keywords has-patch added; needs-patch removed

#6 @SergeyBiryukov
11 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.