Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1007 closed defect (bug) (worksforme)

do_action & arguments

Reported by: dasher's profile dasher Owned by: skippy's profile skippy
Milestone: Priority: normal
Severity: minor Version:
Component: General Keywords: bg|2nd-opinion
Focuses: Cc:


do_action doesn't accept arguments by ref and the newly created args array isn't returned - which makes it hard for hooks to modify arguments or change passed arguments.

It'd be useful if something like the following was possible:

$args = array('varA'=>$varA);
do_action('some-action', &$args);
$varA = $argsvarA?;

Change History (4)

#1 @dasher
19 years ago

  • Patch set to No

#2 @ryan
19 years ago

To do call time pass by reference you have to use the array trick.


do_action('generate_rewrite_rules', array(&$this));

#3 @skippy
19 years ago

  • Keywords bg|2nd-opinion added
  • Owner changed from anonymous to skippy
  • Status changed from new to assigned

so is this still an issue?

#4 @markjaquith
19 years ago

  • Resolution set to worksforme
  • Status changed from assigned to closed

Don't think this is still an issue. Closing. Please reopen if needed.

Note: See TracTickets for help on using tickets.