Allow subscribers to link their listing to gd_place post type

This topic contains 9 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #415099

    Derek Gallimore
    Expired Member
    Post count: 25

    I renamed the “Places” post type to “Companies” and I created a custom post type named “Articles”.

    I enabled article post type link business settings but only administrators can connect a listing to a linkable CPT listing of another user.

    How can I allow subscribers to link/connect listing?

    #415139

    Guust
    Moderator
    Post count: 29970

    Please review https://wpgeodirectory.com/docs/linking-custom-post-types/

    Let us know how you went. Thanks

    #415260

    Derek Gallimore
    Expired Member
    Post count: 25

    Hi Guust,

    Yeah, I was already able to link new listing in another post-type listings but only administrator users. I would like to allow subscriber users to have the same capability.

    Is this possible?

    #415272

    Guust
    Moderator
    Post count: 29970

    Users can only link to their own listings. Anything else would require a customization.
    Thanks

    #415280

    Derek Gallimore
    Expired Member
    Post count: 25

    Do you have any guideline on how to do this? Any existing snippets or hooks?

    I badly need this feature.

    #415311

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I have added a filter for this, if you provide wp-admin and FTP details i will apply it to your site.

    Thanks,

    Stiofan

    #415408

    Derek Gallimore
    Expired Member
    Post count: 25

    Hi Stiofan,

    Could you please just send the filter snippet? I think I can manage to apply it on my site since it is just a filter function.

    Thank you so much.

    #415441

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    sure, first u need to edit the file /geodir_custom_posts/geodir_cpt_link_business.php around line 558

    replace this:

    $condition .= !current_user_can( 'manage_options' ) ? $wpdb->prepare( "AND post_author=%d" , array( (int)$current_user->ID ) ) : '';

    with this:

    
    
    if(apply_filters('geodir_link_to_restrict_author',true)){
            $condition .= !current_user_can( 'manage_options' ) ? $wpdb->prepare( "AND post_author=%d" , array( (int)$current_user->ID ) ) : '';
        }

    Then basically all u have to do is a one line snippet

    add_filter('geodir_link_to_restrict_author','__return_false');

    If you have any problems just let me know 🙂

    Thanks,

    Stiofan

    #415535

    Derek Gallimore
    Expired Member
    Post count: 25

    Hi Stiofan,

    Thank you so much! It worked like a charm.

    All the best.

    #415636

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    🙂

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket