<?php function my_callback( $value, $one, $two, $three ) { echo "Params passed to callback:\n"; print_r( compact( 'value', 'one', 'two', 'three' ) ); return strtoupper( $value ); } function apply_filters( $hook_name, $value, ...$args ) { echo "Params passed to apply_filters():\n"; print_r( compact( 'hook_name', 'value', 'args' ) ); $value = call_user_func_array( 'my_callback', array_values(array( $value, ...$args ) ) ); return $value; } $args = [ 'three' => 3, 'two' => 2, 'one' => 1, ]; $value = call_user_func_array( 'apply_filters', array_merge( array( 'foo', 'bar' ), $args ) ); echo "value: $value\n";
You have javascript disabled. You will not be able to edit any code.