Warning: Undefined array key -1 in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line
185
Warning: Undefined array key 3 in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line
186
Warning: Undefined variable $searchand in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
154
Warning: Undefined array key "a82c32cd4986f859a69b7f203d125fcf" in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
223
Warning: Undefined variable $searchand in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
154
Warning: Undefined array key "a609db2123eb48011bb77371bc433012" in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
223
Warning: Undefined variable $searchand in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
154
Warning: Undefined array key "3b2a0af8bfdc89a0255e782695685f52" in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line
223
描述
如果能力是meta能力,则此函数还接受要映射的对象的ID。meta能力(如edit_post和edit_user)是此函数用来映射到用户或角色所需的基本能力(如,edit_posts或edit_others_posts)的能力。
示例用法:
map_meta_cap( 'edit_posts', $user->ID );
map_meta_cap( 'edit_post', $user->ID, $post->ID );
map_meta_cap( 'edit_post_meta', $user->ID, $post->ID, $meta_key );
此函数不检查用户是否具有所需的能力,只返回所需的能力。
参数
- $cap
-
(string)(必填) 被检查的能力。
- $user_id
-
(int)(必填) 用户ID。
- $args
-
(mixed)(可选) 其他参数,通常从对象ID开始。
更新日志
| 版本 | 描述 |
|---|
| 5.7.0 | 添加了create_app_password、list_app_passwords、read_app_passwordedit_app_password、delete_app_passwords、delete_app_password和update_https能力。 |
| 5.3.0 | 通过将现有且已记录的...$args参数添加到函数签名中,将其形参化。 |
| 5.2.0 | 添加了resume_plugin和resume_theme能力。 |
| 5.1.0 | 添加了update_php能力。 |
| 4.9.6 | 添加了export_others_personal_data、erase_others_personal_data和manage_privacy_options能力。 |
| 2.0.0 | 开始引入 |
Warning: Undefined variable $o in
/www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference.php on line
194