wp_redirect

FUNCTION wp-includes\pluggable.php (ligne 1430) github
Fires once the Ajax request has been validated or not.

Paramètres

Entrée :
$location, $status = 302, $x_redirect_by = 'WordPress'
Sortie :
@param string    $action The Ajax nonce action.
@param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
@param string       $location      The path or URL to redirect to.
@param int          $status        Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
@param string|false $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'.
@return bool False if the redirect was canceled, true otherwise.

Utilisation

// Utilisation de la fonction wp_redirect
$result = wp_redirect($location, $status = 302, $x_redirect_by = 'WordPress');

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

Actualités

Chargement des actualités...