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)

@scribu4 years ago

comment:1 @scribu4 years ago

  • Severity changed from normal to minor

comment:2 @unknowndomain3 years ago

  • Keywords settings-3.6 added

comment:3 @unknowndomain3 years ago

  • Cc me@… added

comment:4 @mordauk3 years ago

  • Cc pippin@… added

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

@scribu3 years ago

refresh for WP 3.6-alpha

comment:6 @scribu3 years ago


comment:7 @ctsttom3 years ago

@scribu I guess that bit hardly changed eh!

comment:8 @SergeyBiryukov3 years ago

  • Keywords settings-api added; settings-3.6 removed

@wonderboymusic2 years ago

comment:9 @wonderboymusic2 years ago

  • Milestone changed from Awaiting Review to 3.7


@wonderboymusic2 years ago

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