• Resolved Anonymous User 13711045

    (@anonymized-13711045)


    I’m using the site-reviews/review/created hook in order to do some stuff after a review is created. I’m trying to get the assigned users but it’s not working. I’ve tried using $review->assigned_users and $review->assignedUsers() but both return an empty array. What is the proper way to get this info? The review itself shows the proper stuff in the admin section, but the filter is not giving me the info as expected.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    The review probably needs to be refreshed.

    Try this:

    add_action('site-reviews/review/created', function ($review) {
        $review = glsr_get_review($review->ID);
        // $review->assigned_users should now work
    }, 10);

    If that doesn’t work, change the hook priority from 10 to 20:

    add_action('site-reviews/review/created', function ($review) {
        $review = glsr_get_review($review->ID);
        // $review->assigned_users should now work
    }, 20);
    • This reply was modified 9 months, 1 week ago by Gemini Labs.
    Thread Starter Anonymous User 13711045

    (@anonymized-13711045)

    I ended up using the $command variable. It actually had all the info in it I needed.

    • This reply was modified 9 months, 1 week ago by Anonymous User 13711045.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with ‘site-reviews/review/created’ Hook’ is closed to new replies.