Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#17884 closed enhancement (fixed)

Remove redundant checks in settings API functions

Reported by: scribu's profile scribu Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.7 Priority: normal
Severity: minor Version:
Component: Administration Keywords: has-patch settings-api 3.6-early
Focuses: Cc:

Description

There are several isset() checks in some settings fields functions that are meant to prevent notices, but they're simply unnecessary.

PHP doesn't emit notices in those cases.

Attachments (4)

17884.diff (2.0 KB) - added by scribu 13 years ago.
17884.2.diff (2.3 KB) - added by scribu 11 years ago.
refresh for WP 3.6-alpha
17884.3.diff (2.3 KB) - added by wonderboymusic 11 years ago.
17884.4.diff (2.5 KB) - added by wonderboymusic 11 years ago.

Download all attachments as: .zip

Change History (14)

@scribu
13 years ago

#1 @scribu
13 years ago

  • Severity changed from normal to minor

#2 @unknowndomain
12 years ago

  • Keywords settings-3.6 added

#3 @unknowndomain
12 years ago

  • Cc me@… added

#4 @mordauk
11 years ago

  • Cc pippin@… added

#5 @ctsttom
11 years ago

  • Keywords 3.6-early added

@scribu Would you be interested in refreshing this code once 3.5.1 is out in the next couple of weeks to get this into 3.6?

@scribu
11 years ago

refresh for WP 3.6-alpha

#6 @scribu
11 years ago

Refreshed.

#7 @ctsttom
11 years ago

@scribu I guess that bit hardly changed eh!

#8 @SergeyBiryukov
11 years ago

  • Keywords settings-api added; settings-3.6 removed

#9 @wonderboymusic
11 years ago

  • Milestone changed from Awaiting Review to 3.7

Refreshed

#10 @wonderboymusic
11 years ago

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

In 25240:

Remove unnecessary checks before setting $wp_settings_* arrays. Adds unit test for setting a nonexistent variable to a multi-dimensional array.

Props scribu.
Fixes #17884.

Note: See TracTickets for help on using tickets.