do_action_ref_array (3 posts)

  1. Colin Robinson
    Posted 4 years ago #

    I'm trying to use this hook
    do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) ); but I'm not having much luck getting it to work.

    Could someone add an example to this page?

  2. Mark / t31os

    Posted 4 years ago #

    Part of the function's description(on the codex page you linked to)..

    This function is identical to do_action, but the arguments passed to the functions hooked to $tag are supplied using an array.

    There's an example on the do_action page.

  3. gary_mazz
    Posted 4 years ago #

    I have just tried do_action_ref_array(). It doesn't work. It still passes the array by value, not reference.

    @Moderator,, Passing by reference allows the each hook to modify the array and pass those alterations to the next hook. The current method, passing by value, does not propagate the changes to the array. They remain in scope to the hook only.

    To work around the issue, make the array global.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.