woocommerce_rest_pre_insert_{$this->post_type}

FILTER woocommerce\includes\rest-api\Controllers\Version1\class-wc-rest-webhooks-v1-controller.php (ligne 550) github
Filter the query_vars used in `get_items` for the constructed query. The dynamic portion of the hook name, $this->post_type, refers to post_type of the post being prepared for insertion.

Paramètres

Entrée :
$data, $request
Sortie :
@param stdClass        $data An object representing a single item prepared
@param WP_REST_Request $request       Request object.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_rest_pre_insert_{$this->post_type}'
add_filter('woocommerce_rest_pre_insert_{$this->post_type}', 'ma_fonction_filtre', 10, 1);

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

Actualités

Chargement des actualités...