I am trying to get these parameters from the do_action placed inside body:
do_action( 'custom_action', array( 'product_id' => $product_id , 'outbiddeduser_id' => $outbiddeduser, 'log_id' => $log_id ) );
I am trying to do it like this:
add_action('custom_action', 'test', 10, 3);
function test($product_id, $outbiddeduser_id, $log_id) {
$a = $product_id;
$b = $outbiddeduser_id;
$c = $log_id;
echo $a . ', ' . $b . ', ' . $c;
}
And this:
add_action('custom_action', 'test', 10, 1);
function test( $associative_array ) {
$a = $associative_array['product_id'];
$b = $associative_array['outbiddeduser_id'];
$c = $associative_array['log_id'];
echo $a . ', ' . $b . ', ' . $c;
}
And it's not working. What am I doing wrong?