GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Not resolved]Allow private custom posts type to list in map for registered users

Forums Support Allow private custom posts type to list in map for registered users

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #55330
    Adage
    Member

    Hello and thank you for the great plugin,
    I have a custom post type and a map that shows it all.
    Now, I set some of the posts to “private” in order to give access to them only for registered users.
    But the map loads without them, even for a registered user !
    How can I include private posts in my map for registered users ?
    Thank you very much !

    #55332

    Hello Adage,
    By default, GEO my WP is set to only display posts set as “Published”. However, there is a hook that allows you to change the arguments pass to the WP_Query.

    The filter hook is ‘gmw_pt_search_query_args’ and can be found in geo-my-wp/plugins/posts/includes/gmw-pt-search-query-class.php.

    Using this hook and a custom function you can modify the ‘post_status’ argument into array( ‘publish’, ‘private’ ).

    I hope that helps.

    #55384
    Adage
    Member

    Thank you very much for this complete awnser.

    #55386
    Adage
    Member

    Hello,
    Instead of using Private vs. Public posts, I’d rather use User Roles.
    For instance, users with “editor” role will see all posts, but “author” will see only some.
    Is there an extension of hook that allows this ?
    Thank you very much.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.