woocommerce_hydration_dispatch_request

FILTER woocommerce\src\Blocks\Domain\Services\Hydration.php (ligne 150) github
Similar to WP core's `rest_dispatch_request` filter, this allows plugin to override hydrating the request. Allows backward compatibility with the `rest_dispatch_request` filter by providing the same arguments.

Paramètres

Entrée :
null, $request, $path, $handler
Sortie :
@param mixed            $hydration_result Result of the hydration. If not null, this will be used as the response.
@param WP_REST_Request  $request          Request used to generate the response.
@param string           $path             Request path matched for the request..
@param array            $handler          Route handler used for the request.

Utilisation

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

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

Actualités

Chargement des actualités...