do_noptin_background_action()
Enqueue an action to run as soon as possible in the background.
Description Description
This is a wrapper for do_action()
.
You can pass extra arguments to the hooks, much like you can with do_action()
.
Example usage:
// The action callback function.
function log_name( $name ) {
// Log the name.
log_noptin_message( $name, 'notice' );
}
add_action( 'log_name_in_the_background', 'log_name', 10, 1 );
// Ask Noptin to fire the hook in the background.
do_noptin_background_action( 'log_name_in_the_background', 'Brian');
See also See also
Parameters Parameters
- $tag
(string) (Required) (required). Name of the action hook. Default: none.
- $arg
(mixed) (Optional) Additional arguments to pass to callbacks when the hook triggers. @return int|bool The action id on success. False otherwise.
Source Source
File: includes/functions.php
function do_noptin_background_action() { return create_noptin_task( func_get_args() )->do_async(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.7 | Introduced. |