[wp-hackers] Adding field(s) before Title and post content on custom post type

Mohammad Jangda batmoo at gmail.com
Fri Jul 16 21:50:03 UTC 2010


>
> For that matter I'd also like to see plugins be able to add new "supports"
> features for custom post types with a register_post_type_support() or
> similar.


I might be misreading what you want, but plugins can already add support for
custom features using add_post_type_support:

<?php
add_action( 'init', 'post_type_support_test' );

function post_type_support_test() {

echo '<p>Do Posts support Authors? ' . ( post_type_supports( 'post',
'author' ) ? 'yes' : 'no' );

echo '<p>Do Posts support Pancakes? ' . ( post_type_supports( 'post',
'pancakes' ) ? 'yes' : 'no' );

add_post_type_support( 'post', 'pancakes' );

echo '<p>Do Posts support Pancakes <em>now</em>? ' . ( post_type_supports(
'post', 'pancakes' ) ? 'yes' : 'no' );
}
?>

--
Mohammad Jangda
www.digitalize.ca | @mjangda


More information about the wp-hackers mailing list