Implementing advanced add_* function wrappers

For simple cases like quick one-liner returns one should remember that it’s possible to hook an anonymous function directly in the add filter call, e.g:

add_filter('some_filter_hook', function($v){return str_replace('..', '.', $v);});

add_action('some_action_hook', function(){echo '....';});

Leave a Comment