可以传递给supports
参数为post_formats
, 删除此参数将修复预览重定向到错误或不存在url的问题。代码示例:
if ( ! function_exists(\'custom_post_type\') ) {
// Register Custom Post Type
function custom_post_type() {
// some code
$args = array(
// \'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'revisions\', \'post-formats\', \'comments\', \'sticky\'),
\'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'revisions\', \'comments\', \'sticky\'),
\'taxonomies\' => array( \'category\', \'post_tag\', \'your_cpt_pictures\', \'your_cpt_updates\', \'your_cpt_outline\' ),
\'capability_type\' => \'post\'
);
register_post_type( \'your_cpt\', $args );
}
// Hook into the \'init\' action
add_action( \'init\', \'custom_post_type\', 0 );