Make WordPress Core

Opened 22 years ago

Closed 21 years ago

#1007 closed defect (bug) (worksforme)

do_action & arguments

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

Description

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
22 years ago

  • PatchNo

#2 @ryan
22 years ago

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

Example:

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

#3 @skippy
21 years ago

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

so is this still an issue?

#4 @markjaquith
21 years ago

  • Resolutionworksforme
  • Status assignedclosed

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

Note: See TracTickets for help on using tickets.