Test 如果当前访问者已登录并注册为用户
// If the user\'s not registered & logged in, abort
if ( ! is_user_logged_in() )
return;
Test 如果当前登录的用户具有特定博客的功能
$blog_id = \'\'; // You need to retrieve and set that here
// If the currently logged in user hasn\'t got the \'manage_options\' cap - which is assigned to admins and above - abort
if ( ! current_user_can_for_blog( $blog_id, \'manage_options\' ) )
return;
如果没有必要检查特定的博客,我们可以只测试功能。
// If the currently logged in user hasn\'t got the \'manage_options\' cap - which is assigned to admins and above - abort
if ( ! current_user_can( \'manage_options\' ) )
return;
This (旧的,未维护的)插件可以让您更好地深入了解用户提供的内容。