admin管理员组文章数量:1278857
I am trying to create a new member. The name of user role is Prime Members and those users should have same capabilities as customer.
I am using following code.
<?php
add_action('init', 'cloneRole');
function cloneRole()
{
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
$adm = $wp_roles->get_role('customer');
//Adding a 'new_role' with all admin caps
$wp_roles->add_role('prime_members', 'Prime Members', $adm->capabilities);
}
?>
When I click on update file button an error shows
Your PHP code changes were rolled back due to an error on line 644 of file C:\xampp\htdocs\wordpress\wp-content\themes\twentytwentyone\functions.php. Please fix and try saving again.
syntax error, unexpected token "<", expecting end of file
本文标签: Error while creating a clone role in wordpress
版权声明:本文标题:Error while creating a clone role in wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741240313a2363845.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论