• Resolved dhsllc

    (@dhsllc)


    Hi, we’ve enjoyed the CPT UI plugin for creating “artists” profile posts.

    Artists have been setup as authors and assigned to their pages; however, when they log in to view and edit their pages, they are not there even though under the “artists” CPT view, we can see their names as authors.

    I have been testing snippets of code hoping to solve this issue without success. Including this:

    // /* pre_get_posts function added to include post type blog in author loop */
    function add_cpt_author( $query ) {
    if ( !is_admin() && $query->is_author() && $query->is_main_query() ) {
    $query->set( ‘post_type’, array(‘post’, ‘artists’ ) );
    }
    }
    add_action( ‘pre_get_posts’, ‘add_cpt_author’ );

    When I move the CPT from “artists” to a regular blog post using Post Type Switcher plugin, the posts do appear under authors and are accessible via backend.

    Any help solving this would be greatly appreciated.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good day @dhsllc

    Can you provide a specific link on the website that should be listing the artists/artists works, but isn’t?

    The snippet above is meant for the author archive url/view, but if your theme is querying for its content at a different spot, then you may have other spots that need to be edited/modified to show properly. For example, if it’s a standard page with a shortcode, then the shortcode arguments may be what’s needed to edit instead.

    Really dependent on some details I don’t know at the present moment.

    Thread Starter dhsllc

    (@dhsllc)

    Hi Michael, the problem I’m troubleshooting is about authors accessing their CPTs so they can edit their entries.

    Right now authors fill out a Gravity Form which populates a CPT post where admins are designated as the authors. At the same time, the authors are setup as subscribers. Once admins review the post and approve, we assign the artist as the authors and approve/publish the posts for public viewing.

    The expectation is for artists to be able to login and edit their post if they wanted to. However, when they log in, there are no posts. When we view the CPT list, we see the authors name. When we look at the author users/roles, it show 0 posts under their name.

    If we move the post from artists CPT to a regular blog posts then the post appears under their user/role and when they login they see the post and can edit then. But, we don’t want to move the ‘artists’ CPT to be a regular blog post. Make sense?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ah,

    This is going to be more an issue around implementation than something that CPTUI is handling. We take care of the registration and do as well with it as we can, but we stay hands off with what’s done with them afterwards.

    I am a little curious if it’s some sort of oddity regarding roles/capabilities for the post type, since things seem to appear once moved to the “post” post type, though by default it should be inheriting much of the same.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CPTs not related to authors’ is closed to new replies.