为子站点WPMU添加新角色

时间:2014-02-04 15:39:48

标签: php wordpress wpmu

我想为WPMU中的所有子网站添加一个新角色,所以我创建了一个文件并尝试了它上面的着名代码(包括wp-blog-header.php之后):

$result = add_role(
    'ret_moderator',
    'مدیر بازنشسته',
    array(
        'read'         => true,  // true allows this capability
        'edit_posts'   => true,
        'delete_posts' => true, // Use false to explicitly deny
        'delete_published_posts' => true,
        'publish_posts' => true,
        'upload_files' => true,
        'read_private_pages' => true,
        'read_private_posts' => true,
        'edit_published_posts' => true,
        'edit_pages' => true,
        'manage_categories' => true,
        'manage_links' => true,
        'list_users' => true
    )
);

它添加了主博客的角色,但它在子网站上是不可见的:) 我自己的想法是将代码放在像主题这样的地方,并在子站点(:D)上打开它,但你知道这不是标准方法。

1 个答案:

答案 0 :(得分:0)

问题在于您将其置于主博客的主题中。

要在所有博客上运行,您应该为wordpress创建一个插件,将代码放在那里,然后将其启用到整个网络(从超级管理面板)。  

祝你好运:)

相关问题