changing variable through filters or action hooks
It won’t work the way you are doing it, but you are close. The reason you have to use a global is that you aren’t setting your $meta variable with the information returned from the filter. This: do_action(‘alter_loop’,$meta); Should be this: $meta = apply_filters(‘alter_loop’,$meta); Note: “Actions” do not return values. “Actions” do things. “Filters” accept … Read more