[wp-hackers] Advice regarding Custom Post Types and Taxonomies

Mike Walsh mpwalsh8 at gmail.com
Fri Aug 10 14:29:29 UTC 2012

I appreciate all of the dialog on my problem, I've read through it all
several times this morning trying to understand the pros and cons of the
various points made.  A couple of comments:

I decided to implement players as their own CPT instead of an extension of
the user profile because of my experience using WordPress to manage a swim
team.  For the swim team plugin I've written (wp-swimteam), parents
register as users and then add their swimmers to the system.  It is a huge
challenge to get parents to use the WordPress Dashboard.  We may not think
twice about logging into it and performing any number of Dashboard actions
but based on my experience working with 500+ swim team families, a lot of
them simply don't understand or more frequently, are lazy and don't want to
be bothered with entering and maintaining their information although they
like to complain when it is wrong.  They want someone to do it for them.

Based on the 5-6 soccer teams we've been involved with over the years, I've
taken the approach with that a team manager is usually responsible for
maintaining the relevant data and making sure it is available to all
players and parents.

Using a CPT for the players I can certainly allow a parent to register as a
user and give them author rights to their player so they can maintain their
player's information but quite frankly, I am pretty sure I don't want to.
 Each player currently has a profile sheet for college recruiting purposes
(a few of the players are probably good enough to play in college but not
all of them but the club asks all players to have a profile sheet).  Think
of it as a resume of sorts.  Some of the parents have taken quite a bit of
creative license with accomplishments which all had to be edited back out
of the documents.  I don't think we'd want to hand over authorship rights
to a player's profile.  In theory it would be wonderful.  In practice I
can't imagine what sort of nonsense would get posted.

So I am back noodling on Ben's suggestion to also define the Roster as a
custom post type instead of a taxonomy like I've currently done.  I am
still not clear that it will help uniquely identify a team/player/roster
combination that I would like to maintain.

I am currently playing with Posts 2 Posts, does anyone have any experience
with CPT-onomies?   http://wordpress.org/extend/plugins/cpt-onomies/ It
looks similar but not exactly like Posts 2 Posts.

On Thu, Aug 9, 2012 at 8:20 PM, Ben Lobaugh <lists at lobaugh.net> wrote:

> Mike,
> Creating a Person post type is pointless because it will be a one to one
> relationship with the User. It is quite easy to extend user profiles to add
> additional fields. I have done so many times on project. I can share code
> with you if you would like.
> A new post will be created each year for PlayerHistory (unless you need to
> track per game) to contain all the stats. You _could_ put that as user meta
> called _Stats20XX if you wanted, but it would be difficult to implement in
> a quick smooth manner. Because it should be one(User) to many
> (PlayerHistory) it is better to keep it as a CPT. It also allows you to
> take advantage of the autogenerated interface in wp-admin and using tools
> such as GravityForms on the frontend if users want to login and manage it.
> Cheers,
> Ben
> On 8/9/12 5:04 PM, Mike Schinkel wrote:
>> Hi Ben,
>> I understand now.  Roster = Team-Year.
>> As for Users being Players, you *might* consider syncing Users with a
>> Person custom post type (although there might be the same problem as with
>> taxonomy and post type, but I don't think so.)  Users are not well suited
>> for the types of things I expect you will want to do with a player, in our
>> experience.
>> PlayerHistory:  Ideally that would be meta associated with your posts
>> relationship but that's yet more infrastructure that's not implemented in
>> WordPress.  You could model it with a post type and that's probably the
>> best thing.
>> Hope this helps.
>>   -Mike
>> On Aug 9, 2012, at 7:52 PM, Ben Lobaugh wrote:
>>  Mike I am really leaning towards multiple CPTs. Otto can smack me over
>>> the head if I am wrong here, but this is what I envision
>>> CPTs:
>>> - Team - Contains the team info (Name, Logo, Description, Location, etc)
>>> - Roster - Each team creates a new roster each year. Rosters can be
>>> managed by the user with admin access to the team (Coach?). A roster will
>>> contain the Team ID as it's parent ID. Each Roster can store the ids of its
>>> players as meta data
>>> - PlayerHistory- Contains historical info on the player (stats, team,
>>> etc). Each player is a user, store that user's id as meta data here
>>> Built in:
>>> - Users: Coaches and Players should be users. Filling out the user's
>>> profile page will add data to them. Their current team can be pulled from
>>> the Roster CPT. Coach historical info could also be stored in Roster and
>>> PlayerHistory possibly
>>> ---- Putting coaches and players in here also allows the system to
>>> expand in the future and allows coaches and players to manage their own
>>> info. A plugin like Members could be used to setup roles and permissions.
>>> 3rd Party Plugins:
>>> - Posts 2 Posts - Could be used to relate the CPTs if you do not want to
>>> do it pragmatically
>>> - Members - Possibly used in the future if you wish to expand the site
>>> to allow players and coaches login access
>>> This system could expand pretty well into a full platform for managing
>>> teams, players, and stats. That may be too complex for your situation
>>> though ;)
Mike Walsh - mpwalsh8 at gmail.com

More information about the wp-hackers mailing list