1

I have created a custom post type, with numerous custom fields. Going forward, when a user signs up to our site, we will then create a CPT (their public information) and assign that user as the author of that newly created custom post type so that they can edit their information from the front end.

Problem is that when I login to the WP Dashboard as a user with Administration access and create a new CP, I then try and change the Author of the CP to the new user. But I can only select users who have Administration access as the Authors of that CP, I can't select the new users (who I've created a custom role for).

This is the code that I've used to add a custom role:

register_activation_hook( __FILE__, 'add_xxxx_roles' );
function add_xxxx_roles() {
   add_role( 'xxxx', __(
    'XXX_seller' ),
array(
    'read'                  => true,
    'edit_posts'            => true,
    'edit_others_posts'     => true,
    'publish_posts'         => true,
    'edit_pages'            => false,
    'create_posts'          => false,
    'edit_themes'           => false,
    'install_plugins'       => false,
    'update_plugin'         => false,
    'update_core'           => false,
    'delete_published_pages'=> false,
    'delete_posts'          => false,
    'delete_pages'          => false,
    'upload_files'          => true,
    'edit_published_posts'  => true,        
) );
}

This may be a simple answer - as in, which role allows users to appear in the custom post type Author list? I'm hoping that's all it is. Please let me know if you need more information or explanation.

Cheers,

  • 1
    My guess in your situation is that it's not that only admin users can be the author, but that the new user is a subscriber and so cannot be set as an author. Try making the new user an Author. – Dan. Dec 1 '16 at 9:45
  • Thanks. That fixed the problem. I had created a new role and given that Authoring privileges - but it looks like there's a problem with that which I have to figure out now. – Cactusman07 Dec 1 '16 at 9:48
  • 1
    No worries. Yeah what you're experiencing now is a bug in WordPress itself which I don't think they've fixed yet - core.trac.wordpress.org/ticket/16841. There is a way around it though, I've done it before just don't remember how. The solution is on google somewhere – Dan. Dec 1 '16 at 9:53
  • Ah, that's good to know! Cheers for the tip then. I'll have to hunt around a bit more. (Unless you can find the appropriate link?) :) – Cactusman07 Dec 1 '16 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.