Support » Plugin: Site Reviews » Abilty to have ‘null’ reviews be ‘0’

  • Resolved dsmoore

    (@dsmoorewp)


    Is there a way to have the review total be set to ‘0’ rather than ‘null’?

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

    (@geminilabs)

    Where is it null?

    Thread Starter dsmoore

    (@dsmoorewp)

    Thanks a ton for the quick reply!

    The null value is showing up in the total value of reviews for each post without any reviews yet. We are able to reset this to zero for the necessary instances, but those changes are reset after each review is submitted.

    Hope that makes more sense.

    Plugin Author Gemini Labs

    (@geminilabs)

    Please send a screenshot, and tell me if you are using a shortcode, helper function, or are using any custom hooks.

    Thread Starter dsmoore

    (@dsmoorewp)

    I’m not sure how to send a screenshot of the null after submission flow, but here is a screenshot of the custom hook that is run after a review is submitted. Perhaps my error is in there?

    Custom Hook

    Hopefully, this helps!

    • This reply was modified 1 month ago by dsmoore.
    Plugin Author Gemini Labs

    (@geminilabs)

    I still don’t understand what the null value is that you are referencing.

    Are you saying that $review->rating is null?

    Please walk me through step-by-step what you are doing to get this null value.

    Also (looking at the screenshot), you can get the first assigned_posts ID and email directly from the $review like this:

    $firstAssignedId = glsr_get($review->assigned_posts, 0);
    $email = $review->email;
    

    The $command object is what was used to create the review.

    Thread Starter dsmoore

    (@dsmoorewp)

    I had a feeling this was going to be tough to explain. Let me start over…

    1. All items that haven’t been reviewed are assigned a default value of null reviews by the plugin.

    2. This doesn’t work for us for a handful of reasons and is very odd since the data output on the page is ‘0 Ratings’.

    3. We fixed this by exposing the total ratings within the WordPress admin item view, allowing us to change the null value to zero easily.

    4. This workaround has to be performed each time a plugin update comes through and most recently after each review is submitted.

    I hope that helps to bring more context.

    Plugin Author Gemini Labs

    (@geminilabs)

    Please use the Contact Support section on the help page to contact me directly.

    Thread Starter dsmoore

    (@dsmoorewp)

    Sent, thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.