do_action pass array argument as reference not copy

I have successive hooks to an action which are passed an associative array like: do_action($array)

I am trying to update the values in this array in the multiple add_action calls, however each add_action is getting a copy of the passed array, not a reference.

Read More

How do I pass a reference? I am using PHP 5.

Related posts

Leave a Reply

2 comments

  1. 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.