schedule_noptin_background_action()

Schedule an action to run once at some defined point in the future.


Description Description

This is similar to do_noptin_background_action() except that the background task fires in the future instead of immeadiately.

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_after_a_day', 'log_name', 10, 1 );

 // Ask Noptin to fire the hook in in the future.
 schedule_noptin_background_action( strtotime( '+1 day' ), 'log_name_after_a_day', 'Brian');

See also See also


Top ↑

Parameters Parameters

$timestamp

(int) (Required) (required) The Unix timestamp representing the date you want the action to run. Default: none.

$tag

(string) (Required) (required) Name of the action hook. Default: none.

$arg

(mixed) (Optional) Additional arguments to pass to callbacks when the hook triggers. Default none. @return int|bool The action id on success. False otherwise.


Top ↑

Source Source

File: includes/functions.php

function schedule_noptin_background_action() {
	$args      = func_get_args();
	$timestamp = array_shift( $args );
	return create_noptin_task( $args )->do_once( $timestamp );
}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.2.7Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation