XPressME Integration Kit

Trac


Ignore:
Timestamp:
Jun 16, 2016, 11:56:31 AM (8 years ago)
Author:
toemon
Message:

WP4.5よりxpressmeでオーバーライドしているget_currentuserinfo()が非推奨となったための対策 Fix #433

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php

    r856 r862  
    1717if ( !function_exists('get_currentuserinfo') ) : 
    1818function get_currentuserinfo() { 
     19    global $current_user; 
     20    global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
     21    xpress_get_current_user();     
     22} 
     23endif; 
     24 
     25if ( !function_exists('wp_get_current_user') ) : 
     26function wp_get_current_user() { 
     27    global $current_user; 
     28    global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
     29    xpress_get_current_user(); 
     30    return $current_user; 
     31} 
     32endif; 
     33 
     34 
     35if ( !function_exists('xpress_get_current_user') ) : 
     36function xpress_get_current_user() { 
    1937        global $current_user; 
    2038        global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
     
    7290                                 } 
    7391                        } 
    74                         wp_set_current_user($user); 
     92                        $user_id = apply_filters( 'determine_current_user', false ); 
     93                        if ( ! $user_id ) { 
     94                            wp_set_current_user( 0 ); 
     95                            return false; 
     96                        } 
     97 
     98                        wp_set_current_user( $user_id ); 
     99 
     100//                      wp_set_current_user($user); 
    75101                } else { // for WP2.0 
    76102                        if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) || 
Note: See TracChangeset for help on using the changeset viewer.