It depends on what the function myAction()
is doing.
Your order is this:
- pluging defines action hook with
do_action( 'bp_members_delete_account_after_submit' );
-
You hook a function on that with
add_action( 'bp_members_delete_account_after_submit', 'action_bp_members_delete_account_after_submit' );
-
the function
action_bp_members_delete_account_after_submit()
is then adding a hook named'myAction'
and passing it two arguments as strings'arg1'
and'arg2'
.
But there is nothing to “happen” in the code above, unless you have a function hooked to myAction
.
add_action( 'myAction', 'my_function', 10, 2 );
function my_function( $first_arg, $second_arg ) {
//here, $first_arg would be literally equal to text 'arg1'
// $second_arg would be literally equal to the text 'arg2'
//you would do stuff here
}
Of course, you could skip some of that and run the code you need run inside the action_bp_members_delete_account_after_submit()
function by making it:
function action_bp_members_delete_account_after_submit() {
//you would do stuff here,
//no need to make another hook if you are not going to hook things to it
}