content-type-standards icon indicating copy to clipboard operation
content-type-standards copied to clipboard

Staff post type?

Open photocurio opened this issue 10 years ago • 10 comments

The most common custom post type I create is a 'staff' post type, so companies can keep track of employees. Maybe this should be a standard.

photocurio avatar Apr 23 '15 11:04 photocurio

gut reaction == ditto

on second thought == perhaps this is a subset of a person(s) standard?

AlchemyUnited avatar Apr 23 '15 12:04 AlchemyUnited

It already is on the list of ideas: https://github.com/justintadlock/content-type-standards/issues/13

So what we need now is a concrete proposal.

kraftner avatar Apr 23 '15 14:04 kraftner

Okay as I'll probably need this soon let's kick this off with a first draft. I have not used CPT prefixes here as discussed in #29.

Post Types

  • person

Taxonomies

  • person_category (This may be e.g. a department or user-level)

Metadata

Person Image

The primary method for getting the person's image is to use their email address to display their avatar/Gravatar via the get_avatar() function.

The secondary method of getting a person's image is to use the standard featured image functionality. Some plugins may opt to only use this method rather than checking for an avatar. This method should use core WP's featured image functionality.

  • Meta key: _thumbnail_id
  • Meta value: 100 (image attachment ID)

Mail

Telephone

  • Meta key: phone
  • Meta value: +1234567 (Just a string, I wouldn't enforce anything here as people use spaces, slashes, letters for numbers and so on)

Twitter

  • Meta key: twitter
  • Meta value: WordPress (just the handle without the @)

Facebook

  • Meta key: facebook
  • Meta value: WordPress

LinkedIn

  • Meta key: linkedin
  • Meta value: matt-m

Xing

  • Meta key: xing
  • Meta value: username

Other data

Name

The post title should serve as the name of the person. (Note: filter the enter_title_here hook.)

Person Description

Plugins should use the standard post content field (post_content) for storing any description of a person.


Issues

Role

One thing I am not sure about is how to assign something like a role, e.g. "CEO". It makes sense as a taxonomy for roles that many people have, but when these are very unique we might have a couple of terms with only one person assigned. So maybe meta makes more sense. Input appreciated.

kraftner avatar Jun 23 '15 18:06 kraftner

Re: Roles: Keeping it simple. Roles are a way to group people. The taxonomy system in WP is for grouping.

justintadlock avatar Jun 23 '15 19:06 justintadlock

most of the contacts look like a "many" with an identifier. e.g.,

id = home phone + # id = cell phone + #

or for social

id = facebook + url id = twitter + url

or is this observation premature?

AlchemyUnited avatar Jun 23 '15 20:06 AlchemyUnited

Also note, we should probably use underscores instead of hyphens for post type/taxonomy names (i.e. person_category) to follow the same methodology as core?

benhuson avatar Jun 24 '15 08:06 benhuson

Also regarding the "many" issue mentioned by @AlchemyUnited, in the hcard and vcard specs this is referred to as "type" if we wanted to use that naming convention for consistency.

For more information see: http://microformats.org/wiki/hcard#type_subproperty_values https://tools.ietf.org/html/rfc6350#section-6.4.1

benhuson avatar Jun 24 '15 08:06 benhuson

@benhuson Underscore of course. Was a typo -> fixed

kraftner avatar Jun 24 '15 08:06 kraftner

Concerning the "many" issue - I haven't thought about that to be honest as I am coming more from the direction of staff and less of a generic person. And in that case you usually only want a single way of contact (per medium at least)

For phone I think it works anyway. As I wouldn't enforce any format for the phone number and just let it be a string you could just make it work: + 1234567 anyway and add multiple phone. Not sure if this approach works for social though...

kraftner avatar Jun 24 '15 09:06 kraftner

@kraftner Adding here: Portable Contacts Standard. Nodejs Passport for e.g. relies on this one, meaning it's highly adopted already.

franz-josef-kaiser avatar May 04 '16 12:05 franz-josef-kaiser