XPressME Integration Kit

Trac

Changeset 70


Ignore:
Timestamp:
Jan 27, 2009, 8:56:36 AM (16 years ago)
Author:
toemon
Message:

wp_redirect()のオーバライド追加
ログアウト時と登録(register.phpを直接コールしたとき)のリダイレクト先変更

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/pluggable-override.php

    r69 r70  
    149149} 
    150150 
     151function wp_redirect($location, $status = 302) { 
     152        global $is_IIS; 
     153         
     154        if ($location == 'wp-login.php?loggedout=true') $location = XOOPS_URL.'/user.php?op=logout'; //xoops logout at wp logout 
     155        if ($location == 'wp-login.php?action=register') $location = XOOPS_URL."/register.php";  //wp-register to xoops register 
     156 
     157        $location = apply_filters('wp_redirect', $location, $status); 
     158        $status = apply_filters('wp_redirect_status', $status, $location); 
     159 
     160        if ( !$location ) // allows the wp_redirect filter to cancel a redirect 
     161                return false; 
     162 
     163        $location = wp_sanitize_redirect($location); 
     164 
     165        if ( $is_IIS ) { 
     166                header("Refresh: 0;url=$location"); 
     167        } else { 
     168                if ( php_sapi_name() != 'cgi-fcgi' ) 
     169                        status_header($status); // This causes problems on IIS and some FastCGI setups 
     170                header("Location: $location"); 
     171        } 
     172} 
    151173// ***********************************  End Of Pluggable Function Edit (wp-include/pluggable.php) ************************************ 
    152174 
Note: See TracChangeset for help on using the changeset viewer.