wp_remote_post

FUNCTION wp-includes\http.php (ligne 192) github
Performs an HTTP request using the POST method and returns its response. Important: If the URL is user-controlled, use `wp_safe_remote_post()` 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_post
$result = wp_remote_post($url, $args = array();

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

Actualités

Chargement des actualités...