Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_redirect [ WordPress Function ]

wp_redirect ( $location, $status = 302 )
Parameters:
  • (string) $location The path to redirect to
  • (int) $status Status code to use
Uses:
Returns:
  • (bool) False if $location is not set
Defined at:



Redirects to another page.

Source


<?php
function wp_redirect($location$status 302) {
    global 
$is_IIS;

    
$location apply_filters('wp_redirect'$location$status);
    
$status apply_filters('wp_redirect_status'$status$location);

    if ( !
$location // allows the wp_redirect filter to cancel a redirect
        
return false;

    
$location wp_sanitize_redirect($location);

    if ( !
$is_IIS && php_sapi_name() != 'cgi-fcgi' )
        
status_header($status); // This causes problems on IIS and some FastCGI setups

    
header("Location: $location"true$status);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics