this is a very general question, which I have really researched. Maybe I'm just being stupid, but I can't quite get when I can use a filter. After some messing around earlier, it seems I can take any function in the core files, pass this as the filter name, and the second argument I can replace this with my own function in the functions.php or plugin file. Is that correct? Can I literally modify anything doing this?
I've been trying to alter some fields on the user profile page, which sucks because some can be altered and some can't as the PHP and HTML doesn't come from a function or class I can work with - it seems certain things can only be changed by hacking around the core files, which I'm not about to do!
So, in summary, can anyone please give me a very short and sweet explanation as to why and when I'd use an action or a filter. This has become I hurdle I wan't to get over! Many thanks ,Dan.
Update: Sample code?
function get_stylesheet_directory() {
$stylesheet = get_stylesheet();
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";
return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}