WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12435 closed defect (bug) (fixed)

use __return_false|true instead of create_function

Reported by: TobiasBg Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

The newly added functions __return_false and __return_true from #12381 should be used throughout core to replace those ugly create_function( ..., 'return true|false;' ); calls.

A quick grep only showed one occurance though, which can be changed with the attached patch.

I also suggest back-porting those two functions to BackPress.

Attachments (1)

12435-return_false.patch (844 bytes) - added by TobiasBg 4 years ago.
Patch replaces one occurance of create_function with new return_false

Download all attachments as: .zip

Change History (5)

TobiasBg4 years ago

Patch replaces one occurance of create_function with new return_false

comment:1 nacin4 years ago

  • Type changed from enhancement to defect (bug)

(Just so it doesn't get lost today in the feature freeze...)

comment:2 dd324 years ago

(In [13546]) use return_false in preference to create_function(..return true..). Props TobiasBg. See #12435

comment:3 dd324 years ago

Leaving this open for any other cases where this may be used that grep hasnt yet found

comment:4 westi4 years ago

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

I've done a sweep and can't find any so closing for now.

Note: See TracTickets for help on using tickets.