WordPress has a great actions and filters system allowing you to create injection points for modifying parts of your code (especially for plugin authors). However, you probably arrived here because you’re trying to echo
or print_r
something from within a filter and not seeing the output.
Because WordPress operates on a post/redirect approach, it means you’re not seeing the output because the page has been reloaded. You need to kill the script from within your filter callback function to see the output.
add_filter('sh_pre_process_body', function($body, $assets_path, $article_file) { $load_file = file_get_contents($article_file); echo $assets_path; die; return shand_fix_content_paths($assets_path, $load_file); }, 10, 3);
By using die
you will be able to see the output or other equivalents that kill script execution. However, the result will mean your site will break until you remove this script killer.