wc_rest_should_load_namespace

FUNCTION woocommerce\includes\wc-rest-functions.php (ligne 400) github
Check if a REST namespace should be loaded. Useful to maintain site performance even when lots of REST namespaces are registered.

Paramètres

Entrée :
string $ns, string $rest_route = ''
Sortie :
@param string $ns The namespace to check.
@param string $rest_route (Optional) The REST route being checked.
@return bool True if the namespace should be loaded, false otherwise.

Utilisation

// Utilisation de la fonction wc_rest_should_load_namespace
$result = wc_rest_should_load_namespace(string $ns, string $rest_route = '');

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...