pre_as_enqueue_async_action

FILTER woocommerce\packages\action-scheduler\functions.php (ligne 40) github
Provides an opportunity to short-circuit the default process for enqueuing async actions. Returning a value other than null from the filter will short-circuit the normal process. The expectation in such a scenario is that callbacks will return an integer representing the enqueued action ID (enqueued using some alternative process) or else zero.

Paramètres

Entrée :
null, $hook, $args, $group, $priority, $unique
Sortie :
@param int|null $pre_option The value to return instead of the option value.
@param string   $hook       Action hook.
@param array    $args       Action arguments.
@param string   $group      Action group.
@param int      $priority   Action priority.
@param bool     $unique     Unique action.

Utilisation

// Modifier la valeur avec le filtre 'pre_as_enqueue_async_action'
add_filter('pre_as_enqueue_async_action', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(null) {
    // Modifier la valeur
    return null;
}

Actualités

Chargement des actualités...