Auto assign Author of listing

This topic contains 5 replies, has 3 voices, and was last updated by  Stiofan O’Connor 7 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #417768

    Piotr Bak
    Free User
    Post count: 2

    Hello,

    I am creating a BuddyPress site on Kleo. I want users to be able to create listings. However, I would love that listing to be automatically assigned to Administrator user, so noone except administrator can edit it nor view it at ‘My listings’ section.

    Is there any simple way to do it by hooks?

    Thanks,
    Piotrek

    #417790

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    There isn’t a setting for that, but I have flagged your question for the developers, and they will reply if there is an easy fix.

    Thanks for joining in at the forum here and we hope your site turns out great!

    #418947

    Piotr Bak
    Free User
    Post count: 2

    Hello Alex,

    Any news on my case?

    Thank you for your help,
    Piotrek

    #418958

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I’m not sure why you would want to do that?
    So no one can view it, whats the point then? 🙂

    If you can explain what you are trying to do i will give you the best solution,
    Do you still want them to get the confirmation email etc?

    Stiofan

    #418960

    Piotr Bak
    Free User
    Post count: 2

    Hello Stiofan!

    Glad that you answered. So, here is the deal:

    I am building BuddyPress community, I want to allow members posting the listings. BUT, as this is a community for people suffering from a rare disease I need full control of each listing and I don’t want people to edit them/delete them.

    So I want them to post listings via frontend submission, each member can (it is not obligatory) receive a confirmational email after submission. Since then members role in listing maintaning is over.

    My best guess was to simple change the author of listing just after the submission, do you have any better idea how to get it to work?

    PS. We used to talk like year ago regarding Support engineer role in your company. I can see that you are guys doing great and your support team is really great. I am working for managed WordPress hosting for ‘heavy’ WP sites (BP, LMS, big networks etc.), let me know if you are looking for a partner in this market niche.

    Thank you for your time Stiofan, really appreciate.
    Cheers,
    Piotrek Bąk

    #419051

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello again Piotrek 🙂

    The below snippet will change the author to whatever u want AFTER the confirmation email has been sent to the user.

    
    
    add_action('geodir_after_save_listing','_my_change_author');
    function _my_change_author($post_id){
       wp_update_post( array('ID' => $post_id,'post_author' => '1') );
    }

    change the ‘1’ with the user id u want to assign it to.

    Thanks,

    Stiofan

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount