wp_remote_get

FUNCTION wp-includes\http.php (ligne 171) github
Performs an HTTP request using the GET method and returns its response. Important: If the URL is user-controlled, use `wp_safe_remote_get()` instead.

Paramètres

Entrée :
$url, $args = array(
Sortie :
@param string $url  URL to retrieve.
@param array  $args Optional. Request arguments. Default empty array.
@return array|WP_Error The response or WP_Error on failure.

Utilisation

// Utilisation de la fonction wp_remote_get
$result = wp_remote_get($url, $args = array();

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

Actualités

Chargement des actualités...