role_has_cap

過濾鉤子
apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name )
引數
  • (bool[]) $capabilities Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.
    Required:
  • (string) $cap Capability name.
    Required:
  • (string) $name Role name.
    Required:
定義位置
相關勾子
clean_site_cacheclean_user_cache
相關方法
like_escapehas_taghas_excerptbefore_last_barattribute_escapeclean_post_cache
引入
2.0.0
棄用
-

role_has_cap: 這個函式確定一個使用者角色是否有一個特定的許可權: 該函式將使用者角色和許可權作為引數,並返回一個布林值,表明該角色是否具有該許可權。

過濾一個角色所具有的許可權。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );

常見問題

FAQs
檢視更多 >