[wp-hackers] WP 3.0 and beyond: Custom post types + custom fields
Emix
emixdemix at gmail.com
Fri Jun 18 21:35:52 UTC 2010
We just released a plugin that should help you: wpeasyposttypes.com
Emilio,
On 18/giu/2010, at 16.30, Matt <logikal16 at gmail.com> wrote:
> Now that the custom post type functionality has been refined with
> 3.0, one
> important next step would be to more closely integrate post types with
> custom fields.
>
> There's no easy way -- using only core -- to assign certain custom
> fields to
> a new post depending on its post type.
>
> For example, a new "Soccer Team" post type. You'd likely want to see
> custom
> fields like "wins", "losses", "home_field", and "roster" (some sort of
> relationship) show up by default when adding a new Soccer Team.
>
> The closest thing I could find was the "register_meta_box_cb"
> argument,
> which lets you add new meta boxes -- not alter the "Custom Fields"
> area.
>
> Here's a *really* rough idea of how this functionality could work:
>
> $args = array(
> 'public' => true,
> 'publicly_queryable' => true,
> 'supports' => array('title', 'editor', 'thumbnail', 'custom-
> fields'),
> 'custom_fields' => array(
> 'wins' => array('label' => __('Wins'), 'widget' => 'number'),
> 'losses' => array('label' => __('Losses'), 'widget' =>
> 'number',
> 'default' => 0),
> 'home_field' => array('label' => __('Home Field'), 'widget' =>
> 'text-single')
> ),
> ... etc ...
> );
> register_post_type('soccer_team', $args);
>
>
> Has any serious thought been given towards this aspect of WP? There
> are
> several plugins out there that attempt to tackle this in various
> ways. I'm
> curious as to if there's much interest in this making it into core,
> and if
> so, what steps have been made thus far.
>
> Matt
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list