do_action pass array argument as reference not copy

This question already has an answer here:

  • Difference between do_action_ref_array() and do_action()

    1 answer

Solutions Collecting From Web of "do_action pass array argument as reference not copy"

The way to pass by reference to a WP action is with:
do_action_ref_array('action_hook', array(&$data) );

do_action which is hooked using add_action is not meant for altering values more then its meant for executing your function at a certain point. Instead use
apply_filter which is hooked using add_filter which is meant to allow altering a value.