WordPressadd_action()


Syntax

  • add_action( $tag, $function_to_add )
  • add_action( $tag, $function_to_add, $priority )
  • add_action( $tag, $function_to_add, $priority, $accepted_args )

Parameters

ParameterDetails
$tag(string) The name of the action to which the procedure $function_to_add will be hooked.
$function_to_add(callable) The callable function/procedure you want to be called.
$priority(int) The priority level to which the $function_to_add will be executed. Optional. Default 10.
$accepted_args(int) The number of arguments that the callable function $function_to_add accepts. Optional. Default 1.