Make WordPress Core

Opened 4 years ago

Closed 21 months 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 2 years ago.
refresh for WP 3.6-alpha
17884.3.diff (2.3 KB) - added by wonderboymusic 22 months ago.
17884.4.diff (2.5 KB) - added by wonderboymusic 21 months ago.

Download all attachments as: .zip

Change History (14)

@scribu4 years ago

comment:1 @scribu4 years ago

  • Severity changed from normal to minor

comment:2 @unknowndomain2 years ago

  • Keywords settings-3.6 added

comment:3 @unknowndomain2 years ago

  • Cc me@… added

comment:4 @mordauk2 years ago

  • Cc pippin@… added

comment:5 @ctsttom2 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?

@scribu2 years ago

refresh for WP 3.6-alpha

comment:6 @scribu2 years ago


comment:7 @ctsttom2 years ago

@scribu I guess that bit hardly changed eh!

comment:8 @SergeyBiryukov2 years ago

  • Keywords settings-api added; settings-3.6 removed

@wonderboymusic22 months ago

comment:9 @wonderboymusic22 months ago

  • Milestone changed from Awaiting Review to 3.7


@wonderboymusic21 months ago

comment:10 @wonderboymusic21 months 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.