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.

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

2 Answers
2

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

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *