Skip to content

Check hook callback is not boolean #1653

@GaryJones

Description

@GaryJones

Is your feature request related to a problem?

A client wanting to return false to a filter, did:

	add_filter( 'liveblog_entry_enable_embeds', false );

...instead of:

	add_filter( 'liveblog_entry_enable_embeds', '__return_false' );

Describe the solution you'd like

When a boolean false or true is given as the second arg of add_filter() or add_action(), make it an Error with a suggestion of what to use instead.

This could be extended to look for other __return_() functions, like null, 0, array(), etc.

Perhaps an error with a more vague message if it's anything non-callable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions