Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Role Blog Creation Issues


  • Ben
    Participant

    @communicatorsinaction

    Greetings,

    I’m running WP 3.5 and BP 1.6.3 (you can see the site here: http://community.communicatorsinaction.com/). I have recently enabled the blog creation feature for users, but am facing a rather strange problem.

    When an existing user creates a site (via `/blogs/create/`), their default user role is “None”. Since this is the case, when the user tries to access the dashboard of their new site, they are given the “You do not have permission to access this page” message. So, something is messing up the default blog user role when an existing user creates a blog. However, when a user creates a blog and an account at the same time, the user is the administrator of their site and there are no issues.

    In order to solve this problem I installed the New Blog Default User Role plugin and set it to “Administrator” to see if that helped, but to no avail. I also tried to deactivate/activate a few plugins, but this didn’t help either.

    It’s a weird problem, and I think has to do with some user role bug, but I would appreciate any help or thoughts on the issue.

    Thanks!
    Ben

Viewing 8 replies - 1 through 8 (of 8 total)
  • Interesting. What other plugins do you have running?


    Ben
    Participant

    @communicatorsinaction

    To name some of the more likely possibilities:

    • Jetpack
    • Bad Behavior
    • FV Antispam
    • bbPress
    • BP Xtra Signup
    • Invite Anyone
    • Network Latest Posts
    • New Blog Defaults
    • Welcome Pack
    • WordPress SEO

    I noticed after posting this yesterday that the form on the registration page (which works) is hard coded into the form, whereas the one on the `/blogs/create/` page is generated by the `bp_show_blog_signup_form();` function. Is it possible that the different functions that are run upon submission (on signup vs. blog creation) are be different enough to make this error occur?

    …Maybe I’m barking up the wrong tree…

    Thanks for your time,
    Ben


    Ben
    Participant

    @communicatorsinaction

    Turns out my issue was with bbPress. If I deactivate bbPress there are no problems with creating a blog through `/blogs/create/`. I know that more recent versions of bbPress (I’m running 2.2.3) have created their own user roles, perhaps @JohnJamesJacoby can help me understand this issue.

    I’ll try a few things and then report back here if I find a solution.

    Thanks!
    Ben

    Suggest you file a bug report on https://bbpress.trac.wordpress.org


    Ben
    Participant

    @communicatorsinaction

    Thanks for your help @djpaul, I’ve filed the bug here: https://bbpress.trac.wordpress.org/ticket/2161


    Ben
    Participant

    @communicatorsinaction

    For those of you interested I’ve found a temporary solution that works perfectly:

    `// When a User Creates a New Blog, Force the Administrator Role (bbPress Bug Temp Fix)

    function bp_fix_blog_role($blog_id, $user_id) {
    add_user_to_blog($blog_id, $user_id, ‘administrator’ );
    }
    add_action( ‘wpmu_new_blog’, ‘bp_fix_blog_role’, 10, 2 );`

    Just drop this bad boy in your `mu-plugins` folder and you’re good to go. If you want a different default role for your users, just set “administrator” to whatever you want (editor, author, etc.). The beauty of this function is that it runs immediately after the blog is created, so it will fix any issues you have during blog creation.

    Source: https://wordpress.org/support/topic/how-do-i-change-the-default-administrator-role-to-author-for-new-users


    s_mari20
    Participant

    @s_mari20

    Hello, I am interested in this option too, I want to give the user role to author when we makes new blog(site), and I saw your code above. But where shall I put this code? In buddypress files? But where?
    thank you

    Not only is ‘where’ mentioned in the post above there is a link to a discussion in greater detail on the WP forums, please read first before asking ‘where’ if things are still unclear.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘User Role Blog Creation Issues’ is closed to new replies.
Skip to toolbar