ActionScheduler_AdminView::maybe_check_pastdue_actions()publicWC 1.0

Action: admin_notices

Maybe check past-due actions, and print notice.

Method of the class: ActionScheduler_AdminView{}

Return

null. Nothing (null).

Usage

$ActionScheduler_AdminView = new ActionScheduler_AdminView();
$ActionScheduler_AdminView->maybe_check_pastdue_actions();

ActionScheduler_AdminView::maybe_check_pastdue_actions() code WC 8.7.0

public function maybe_check_pastdue_actions() {

	# Filter to prevent checking actions (ex: inappropriate user).
	if ( ! apply_filters( 'action_scheduler_check_pastdue_actions', current_user_can( 'manage_options' ) ) ) {
		return;
	}

	# Get last check transient.
	$last_check = get_transient( 'action_scheduler_last_pastdue_actions_check' );

	# If transient exists, we're within interval, so bail.
	if ( ! empty( $last_check ) ) {
		return;
	}

	# Perform the check.
	$this->check_pastdue_actions();
}