Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#17884 closed enhancement (fixed)

Remove redundant checks in settings API functions

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


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 4 years ago.
17884.2.diff (2.3 KB) - added by scribu 3 years ago.
refresh for WP 3.6-alpha
17884.3.diff (2.3 KB) - added by wonderboymusic 2 years ago.
17884.4.diff (2.5 KB) - added by wonderboymusic 2 years ago.

Download all attachments as: .zip

Change History (14)

4 years ago

#1 @scribu
4 years ago

  • Severity changed from normal to minor

#2 @unknowndomain
3 years ago

  • Keywords settings-3.6 added

#3 @unknowndomain
3 years ago

  • Cc me@… added

#4 @mordauk
3 years ago

  • Cc pippin@… added

#5 @ctsttom
3 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?

3 years ago

refresh for WP 3.6-alpha

#6 @scribu
3 years ago


#7 @ctsttom
3 years ago

@scribu I guess that bit hardly changed eh!

#8 @SergeyBiryukov
3 years ago

  • Keywords settings-api added; settings-3.6 removed

#9 @wonderboymusic
2 years ago

  • Milestone changed from Awaiting Review to 3.7


#10 @wonderboymusic
2 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.