PHP 클래스 WPAS_Member

부터: 3.3
파일 보기 프로젝트 열기: awesome-support/awesome-support 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$caps array User capabilities
$data array User profile data
$is_member boolean Whether or not the user requested is a member of Awesome Support
$roles array User roles
$user_id integer User ID

공개 메소드들

메소드 설명
__construct ( integer | stdClass $user ) WPAS_Member constructor.
has_cap ( string $cap ) : boolean Check if the user has a specific capability
is_member ( ) : boolean Check if the current user actually is an Awesome Support member

보호된 메소드들

메소드 설명
data_defaults ( ) : array Get the default profile data fields
get_user_data ( $user_id ) : array Get user data by user ID
init ( $data ) : void Setup the user data
setup_caps ( ) : void Setup the user capabilities based on their roles
setup_roles ( ) : void Setup the user roles

메소드 상세

__construct() 공개 메소드

WPAS_Member constructor.
public __construct ( integer | stdClass $user )
$user integer | stdClass The user ID or stdClass

data_defaults() 보호된 메소드

This is also used as a whitelist. Only fields listed in the defaults will be actually used as the user $data
부터: 3.3
protected data_defaults ( ) : array
리턴 array

get_user_data() 보호된 메소드

Get user data by user ID
부터: 3.3
protected get_user_data ( $user_id ) : array
$user_id
리턴 array

has_cap() 공개 메소드

Check if the user has a specific capability
부터: 3.3
public has_cap ( string $cap ) : boolean
$cap string Capability to check
리턴 boolean

init() 보호된 메소드

Setup the user data
부터: 3.3
protected init ( $data ) : void
$data
리턴 void

is_member() 공개 메소드

Check if the current user actually is an Awesome Support member
부터: 3.3
public is_member ( ) : boolean
리턴 boolean

setup_caps() 보호된 메소드

This method is mostly based on WordPress' WP_User::get_role_caps()
부터: 3.3
protected setup_caps ( ) : void
리턴 void

setup_roles() 보호된 메소드

Setup the user roles
부터: 3.3
protected setup_roles ( ) : void
리턴 void

프로퍼티 상세

$caps 공개적으로 프로퍼티

User capabilities
부터: 3.3
public array $caps
리턴 array

$data 공개적으로 프로퍼티

User profile data
부터: 3.3
public array $data
리턴 array

$is_member 공개적으로 프로퍼티

Whether or not the user requested is a member of Awesome Support
부터: 3.3
public bool $is_member
리턴 boolean

$roles 공개적으로 프로퍼티

User roles
부터: 3.3
public array $roles
리턴 array

$user_id 공개적으로 프로퍼티

User ID
부터: 3.3
public int $user_id
리턴 integer