Moved the add_filter below the function to be compatible with the WordPress standard.