Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ticanupston

    (@ticanupston)

    I am trying to mess with the New Blog Defaults plugin to do this, but can’t seem to get it to work. I’ve tried two strategies: both involve using previously found code to incorporate into the plugin, but I haven’t been able to see success with either strategy.

    Strategy 1: Use the code used in wp-admin/includes/upgrade.php (roughly line 81)

    $user = new WP_User($user_id);
    $user->set_role('editor');

    Strategy 2: Use the code I found on the other post to incorporate into the plugin:

    <?php
    function ds_new_user_meta($blog_id, $user_id) {
     add_user_to_blog($blog_id, $user_id, 'editor' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );
    ?>

    Can you maybe guide me a little more on how to get the New Blog Defaults plugin to do this?

    Thread Starter ticanupston

    (@ticanupston)

    DeannaS, thanks for the response. I really appreciate it. I will experiment with New Blog Defaults as you mention..and report back.

    This is all stemming from the fact that I have severely limited the functionality and physical view of the admin dashboard for new users (who are editors). I have successfully set up plugins and a bit of custom code for that.

    The process I currently follow is to manually create a site (at that point I as the network admin am the admin of that site with no other owner or user). Then I add a user to that newly created site, and I can choose to make them an editor, which applies all my admin restrictions for that user. Its simple, but still a manual process.

    What I want to do is to allow people to sign up at wp-signup.php and have that whole process be automated, so when they log in for the first time, they are already an editor, not an admin of their own site.

    Thread Starter ticanupston

    (@ticanupston)

    To update this – I’m getting desperate, so I even tried updating line 81 in wp-admin/includes/upgrade.php – with no success:

    $user = new WP_User($user_id);
    $user->set_role('editor');

    Any thoughts here?

Viewing 3 replies - 1 through 3 (of 3 total)