Set beans_add_action() using the callback argument as the action ID.

This function is a shortcut of beans_add_action(). It does’t require an ID to be specified and uses the callback argument instead.

beans_add_smart_action( string $hook, callback $callback, int $priority = 10, int $args = 1 )

Return: (bool) Will always return true.


$hookstringtrue-The name of the action to which the $callback is hooked.
$callbackcallbacktrue-The name of the function you wish to be called. Used to set the action ID.
$priorityintfalse10Used to specify the order in which the functions associated with a particular action are executed. Default 10. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
$argsintfalse1The number of arguments the function accept. Default 1.


function beans_add_smart_action( $hook, $callback, $priority = 10, $args = 1 ) {

	return beans_add_action( $callback, $hook, $callback, $priority, $args );