Support » Plugin: Site Reviews » Display reviews with 4 stars only

  • Resolved jrswordpress

    (@jrswordpress)


    Hello,
    [site_reviews assigned_to=”post_id” rating=”4″] shows all reviews in the post with a minimum of 4 star rating. This includes 5 star rated reviews. Is there a way to display only reviews with 4 stars?

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

    (@geminilabs)

    Thread Starter jrswordpress

    (@jrswordpress)

    @geminilabs Beautiful, this works flawlessly. Thank you for this fantastic support and plugin! I am about to go rate this gem. 5stars from me 👏🏻 👏🏻

    Thread Starter jrswordpress

    (@jrswordpress)

    • This reply was modified 3 years, 9 months ago by jrswordpress.
    Plugin Author Gemini Labs

    (@geminilabs)

    You can use either the glsr_debug or glsr_log helper functions to help you figure this out. At the end of the code, add this to print the WP_Query object directly to the page:

    glsr_debug( $query ); // or: apply_filters( 'glsr_debug', null, $query );
    

    Alternatively, add this instead to print the WP_Query object to the plugin’s console (and if you have the Black Bar plugin installed, it will also show up in the Black Bar console…actually, this is only with Site Reviews v3.6.0):

    glsr_log( $query ); // or: apply_filters( 'glsr_log', null, $query );
    

    This will show you that the WP_Query object includes the following:

    [meta_key] => pinned
    [order] => DESC
    [orderby] => meta_value date

    Now that you know the existing values, simply change them to the ones you want. For example:

    $query->set( 'meta_key', 'kodex_post_likes_count' );
    $query->set( 'orderby', 'meta_value_num date' );
    • This reply was modified 3 years, 9 months ago by Gemini Labs.
    • This reply was modified 3 years, 9 months ago by Gemini Labs.
    • This reply was modified 3 years, 9 months ago by Gemini Labs.
    • This reply was modified 3 years, 9 months ago by Gemini Labs.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display reviews with 4 stars only’ is closed to new replies.