Add Excerpts, Revisions and More to Any Post Type
Switches on editor features such as excerpts, revisions, page attributes or custom fields for post types that were registered without them.
Opens WPIDE on
Code
// Post type => features to add.
$wpide_add_supports = array(
'page' => array( 'excerpt' ),
'portfolio' => array( 'revisions', 'excerpt', 'page-attributes' ),
);
add_action( 'init', function () use ( $wpide_add_supports ) {
foreach ( $wpide_add_supports as $type => $features ) {
if ( post_type_exists( $type ) ) {
add_post_type_support( $type, $features );
}
}
}, 99 );
Notes
Feature names: title, editor, author, thumbnail, excerpt, comments, revisions, page-attributes, custom-fields.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.