WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#35466 new defect (bug)

`add_filter()` errors when `spl_object_hash()` not exists

Reported by: yaquawa Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.1
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

add_filter() will errors when the following conditions are met.

  1. $function_to_add is Closure
  2. spl_object_hash function not exists

For example:

add_filter( 'template_include', function($args){
	return $args;
},90 );

Change History (1)

#1 @swissspidy
4 years ago

This has previously been discussed in #10535. Duplicate?

Last edited 4 years ago by swissspidy (previous) (diff)
Note: See TracTickets for help on using tickets.