Make WordPress Core

Opened 6 years ago

Closed 6 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:


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 6 years ago.
Patch replaces one occurance of create_function with new return_false

Download all attachments as: .zip

Change History (5)

@TobiasBg6 years ago

Patch replaces one occurance of create_function with new return_false

comment:1 @nacin6 years ago

  • Type changed from enhancement to defect (bug)

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

comment:2 @dd326 years ago

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

comment:3 @dd326 years ago

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

comment:4 @westi6 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.