[theme-reviewers] Per-Post Layout Options

Justin Tadlock justin at justintadlock.com
Wed Aug 10 17:22:41 UTC 2011


I'm not opposed to these suggestions if they're merely recommendations.

I use post meta across multiple themes with the same meta key.  This at 
least ensures compatibility with features across my themes.  Not to 
mention, several developers use the Hybrid Core framework, so there's 
some standardization for meta keys with themes that I didn't create.  I 
know my users are just a drop in the ocean compared to the entire WP 
user base, but at least a few hundred thousand users can have some 
standardization.

As for the underscore prefix, I typically choose not to do this with 
themes.  This way, the user can still see that they can use this 
metadata, even after they switch themes.  For me, it depends entirely 
upon the situation.  If I want the user to be able to easily access this 
data in the future, I don't use the underscore.

In general, I believe using a prefix and underscore are extremely good 
practices, especially if the data is specific to just that one theme.

On 8/9/2011 8:06 AM, Chip Bennett wrote:
> This is great advice, and probably something that should be added to 
> the Codex: prefix custom post meta fields with theme-slug. Anyone 
> opposed to me adding this to the Guideline regarding proper namespacing?
>
> I would also add (as best-practice, or as a requirement?) that custom 
> post meta fields that are handled by metaboxes should be prefixed with 
> an underscore, so that they are hidden from the Custom Fields metabox.
>
> Chip
>
> On Mon, Aug 8, 2011 at 3:43 PM, Otto <otto at ottodestruct.com 
> <mailto:otto at ottodestruct.com>> wrote:
>
>     On Mon, Aug 8, 2011 at 12:27 PM, Chip Bennett
>     <chip at chipbennett.net <mailto:chip at chipbennett.net>> wrote:
>     > I am considering adding post meta to allow for per-post layout
>     selection. It
>     > is simple enough to implement; however, here's my question:
>     would this cross
>     > the content/presentation line? Or expressed differently: would it be
>     > inappropriate to add Theme-specific custom post meta in this
>     manner, given
>     > that such metadata would be mostly useless to the user after
>     switching
>     > Themes?
>
>     Post meta for this use is fine, just prefix the meta key with your
>     theme name so that it's obvious where the meta came from.
>
>     Not necessary to offer a cleanup option as such, but might be a
>     nice feature.
>
>     -Otto
>     _______________________________________________
>     theme-reviewers mailing list
>     theme-reviewers at lists.wordpress.org
>     <mailto:theme-reviewers at lists.wordpress.org>
>     http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110810/6dd80b0d/attachment-0001.htm>


More information about the theme-reviewers mailing list