0

I'm currently working on a University project which is a website for managing a GameJam events occurring every 6 months. Our users will be in teams of 1 to 4 people and will be able to post about their game development live on our website during 48h. Last year, we used a simple wordpress blog and told our users not to post in other categories, but it's getting bigger this year and we want more restrictions.

I've made a plugin that handles custom post types but I'm wondering how could I integrate Teams in the wordpress role system.

I have made a new role which is gamejam_user. The custom post have these capabilities:

'capability_type' => 'teams_post',
'capabilities' => array(
    'delete_others_posts' => 'delete_others_teams_posts',
    'delete_post' => 'delete_teams_post',
    'delete_posts' => 'delete_teams_posts',
    'delete_private_posts' => 'delete_private_teams_posts',
    'delete_published_posts' => 'delete_published_teams_posts',
    'edit_others_posts' => 'edit_others_teams_posts',
    'edit_post' => 'edit_teams_post',
    'edit_posts' => 'edit_teams_posts',
    'edit_private_posts' => 'edit_private_teams_posts',
    'edit_published_posts' => 'edit_published_teams_posts',
    'publish_posts' => 'publish_teams_posts',
    'read_private_posts' => 'read_private_teams_posts',
    'read_posts' => 'read_teams_posts'
),

But now, I'm just not sure how I'll integrate the team system as teams cannot edit other teams posts but users in a specific team can edit other posts in the same team.

The simple way could be to make the users create one account for their team and to use only this account, but it's not what we are looking for, our next event is in 1 week so this is probably what we will do, but since this is a 2events per year, I'll definitely need a way to accomplish this with the plugin.

Note: The team creation is backend only, Teams could have their own page with the loop of their own posts included at the bottom of their page (this could be done with a hook for each posts if teams were custom post types but how to tell wordpress a custom post type is also a group of users? And how can we create a new capability that says you can edit others posts but only the ones from people in your team?).

Any Idea?

4
  • Why don't you set up a multi-site and give each team its own site?
    – fuxia
    Commented Sep 30, 2012 at 22:02
  • That is a good solution, but we only want our users to make simple posts without managing a complete website (we only want them to make some posts) so they can put more time on their game's code. At the moment, people can chat on the backend and have different informations on the event, wich is great, but I'm not sure if the backend widgets are shared through wordpress multi-sites, I will study this idea this week. Thanks for your tip :)
    – GabLeRoux
    Commented Oct 1, 2012 at 1:34
  • If you give the user very restricted roles they cannot do much more than posting. The rest of the interface will be hidden. All multi-site users are stored in the same tables (user and usermeta), so you can give them another role on the master site without new accounts.
    – fuxia
    Commented Oct 1, 2012 at 1:40
  • Sounds good, i will definitly give this a try. The student association that organise this event is always very busy (luckily, I have some time this week) so I started making the plugin to have an automated system for every event. I'll see if I can adapt the hole thing to multi-site system, thanks alot :)
    – GabLeRoux
    Commented Oct 1, 2012 at 12:38

1 Answer 1

1

Use a multi-site installation (see our tag), give each team its own sub-site on /team-name/ and use the master site for the rest.

Advantages

  • All users on a multi-site setup are stored in the same database, they don't need a separate account for the main site.
  • You can give each user a different role for the main site and any sub-sites.
  • Users will only see the posts or settings they are responsible for. You don't have to fiddle with access restrictions because WP will do the dirty work for you automatically.

Disadvantages

  • Exporting/backing up everything at once might be more difficult.
  • You will probably build a feed on the main site for all sub-sites. There are plugins for that, but no automatic.
  • You cannot use a page on the main site with the same slug as a sub-site. Or you have to use sub-domains for the sub-sites, but in your use case I think that would not look integrated enough.
1
  • I will give this a try after the event (at the moment, What I did works fine enough for our event). I don't know much about Wordpress Multi-site yet, but I'll probably find a way to automatically create a sub-site for each new teams. Thanks for your clear answer :)
    – GabLeRoux
    Commented Oct 2, 2012 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.