can you assistance to solved this problem I attempted to produce a new hook in wordpress do_action and add_action.

Here's my code below

    $arg1 = 'args test 1';
    $arg2 = 'args test 2';

    do_action('action1',$arg1, $arg2);

    function test_function($arg1, $arg2) {
       echo $arg1.$arg2;
    }

    add_action('action1','test_function',10,2);

After I attempted to operate my scripts nothing's happen it will display the $arg1 and $args2 ,What ought to be the issue is there anything wrong using the scripts ?

That's about places, you take action before you decide to set that

Try such as this :

$arg1 = 'args test 1';
$arg2 = 'args test 2';


function test_function($arg1, $arg2) {
   echo $arg1.$arg2;
}

add_action('action1','test_function',10,2);

do_action('action1',$arg1, $arg2);

now thats should work