-
-
Notifications
You must be signed in to change notification settings - Fork 524
Open
Labels
Component: ExtraFocus: Code analysisSniffs to prevent common mistakes and improve code in generalSniffs to prevent common mistakes and improve code in generalType: Enhancement
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: ExtraFocus: Code analysisSniffs to prevent common mistakes and improve code in generalSniffs to prevent common mistakes and improve code in generalType: Enhancement