wc_get_template

ACTION woocommerce\includes\rest-api\Controllers\Version2\class-wc-rest-system-status-v2-controller.php (ligne 1352) github
Scan the theme directory for all WC templates to see if our theme overrides any of them.
traduction française
Examinez le répertoire des thèmes pour tous les modèles WC afin de voir si notre thème remplace l'un d'entre eux.

Paramètres

Entrée :
$file, $file, array(
Sortie :
N/A

Utilisation

Récupérer un template WooCommerce

Charger un template avec des arguments personnalisés

ui technical
// Utiliser un template WooCommerce
wc_get_template(
    'cart/cart.php',
    array(
        'custom_var' => 'valeur',
        'another_var' => $data
    )
);

// Les variables seront disponibles dans le template

Actualités

Chargement des actualités...