Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#24733 closed defect (bug) (fixed)

Unused code in WP_Widgets::update_callback()

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

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

Download all attachments as: .zip

Change History (7)

#1 @ocean90
13 years ago

  • Keywords needs-patch added
  • Milestone Awaiting Review → 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
13 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
13 years ago

  • Keywords good-first-bug added

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


13 years ago

@OriginalEXE
13 years ago

#5 @OriginalEXE
13 years ago

  • Keywords has-patch added; needs-patch removed

#6 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 27224:

Remove unused code from WP_Widget::update_callback().

props OriginalEXE.
fixes #24733.

Note: See TracTickets for help on using tickets.