I like to think of add_filter
as a way for you to adjust a variable. It can be used anywhere you see an apply_filters
in the code. Typically, you return
a variable value instead of echoing it out.
Your example would be better written like so:
function remove_footer_admin () {
return 'Fueled by <a href="http://www.wordpress.org" target="_blank">WordPress</a> | Designed by <a href="http://www.uzzz.net" target="_blank">Uzzz Productions</a> | WordPress Tutorials: <a href="http://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';
}
add_filter('admin_footer_text', 'remove_footer_admin');
And remove_footer_admin()
would be run when the WP code hits the
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . __( 'Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.' ) . '</span>' );
in admin-footer.php…where the second parameter (<span>
and so forth) is the variable that apply_filters
is allowing you to modify in this instance.
I wrote a tutorial on WordPress filters that I think might help explain some things.