Wordpress - How do I change the author of a custom post type?

in Custom Post Type register arguments array use this

'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'),

This will activate author box on the edit screen. After registering author to cpt you need to activate author from edit screen option ( top of the edit screen where you can enable/disable all metabox ) to display authorbox on the edit screen.


I found out that the edit author attribute is not added by default in for custom post types. To add the author attribute the following code is required:

function allowAuthorEditing()
{
  add_post_type_support( 'mytype', 'author' );
}

add_action('init','allowAuthorEditing');

Go to Screen Options in the top right corner and check the box that says Author. It will then display the Author meta box. This is possibly the worst user experience in WordPress. It confuses so many people.