Need Developer to do this for me

This topic contains 22 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
  • #398530

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    yes and yes, its just a comma separated user id array.

    Stiofan

    #398561

    Shane Blevins
    Expired Member
    Post count: 25

    Hi Stiofan,
    Thank you again for the help.
    I tried the below code (the user Id fort the test account was 2

    add_filter(‘geodir_new_post_default_status’,’_allow_some_users_live’);
    function _allow_some_users_live($status){
    $allowed_user_ids = array();
    $user_id = get_current_user_id(2);

    if(in_array($user_id,$allowed_user_ids)){
    $status = ‘publish’;
    }

    return $status;
    }

    It doesn’t seem to have done anything. I tried under the test account to publish a post and it still went to pending status.
    Do I also need to put a 2 in here as this ,,,,,,,,array(2); or did I mess up somewhere else?

    #398562

    Shane Blevins
    Expired Member
    Post count: 25

    Also just to make sure I’m not making a foolish mistake here is where I determined the ‘2’ was the user id for the test account

    wp-admin/user-edit.php?user_id=2&wp_http_referer=%2Fwp-admin%2Fusers.php%3Fpaged%3D3

    #398612

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    if you had a user with id 2 you would put:

    
    
    $allowed_user_ids = array(2);
    $user_id = get_current_user_id();

    If you want to allow users ids 2 and 30 and 400 you would put:

    
    
    $allowed_user_ids = array(2,30,400);
    $user_id = get_current_user_id();

    Stiofan

    #398620

    Shane Blevins
    Expired Member
    Post count: 25

    Stiofan,
    Thank you so much!!! Worked perfectly! I guess I some how mixed it up and put it in the wrong line the first time. That is exactly what I needed. You guys here are awesome.

    #398623

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome! 🙂 Feel free to leave us a review to help us grow https://wordpress.org/support/plugin/geodirectory/reviews/?rate=5#new-post

    Stiofan

    #398628

    Shane Blevins
    Expired Member
    Post count: 25
    #398640

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Excellent, thank you so much! 🙂

Viewing 8 posts - 16 through 23 (of 23 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