Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12435 closed defect (bug) (fixed)

use __return_false|true instead of create_function

Reported by: tobiasbg's profile 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 15 years ago.
Patch replaces one occurance of create_function with new return_false

Download all attachments as: .zip

Change History (5)

@TobiasBg
15 years ago

Patch replaces one occurance of create_function with new return_false

#1 @nacin
15 years ago

  • Type changed from enhancement to defect (bug)

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

#2 @dd32
15 years ago

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

#3 @dd32
15 years ago

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

#4 @westi
15 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.