📜  get_user_meta - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:07.976000             🧑  作者: Mango

代码示例2
global $current_user; 
 
get_currentuserinfo();
 
if ( $current_user ) {
    $permission = get_user_meta( $current_user->ID, 'some_meta' , true );
     
    if ( ! empty( $permission ) ) {
        // do stuff
    }
}
// works for both array and single values