Support » Plugin: Strong Testimonials » Where is the shortcode data stored

  • Resolved Onno454

    (@onno454)


    Hi there,
    Can you please tell me where and how you store the data for the shortcodes: [testimonial_count] and [testimonial_average_rating]?

    Thank you so much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @onno454,

    That information is not stored in the database.
    [testimonial_count] counts all the published testimonials and displays the number.
    And testimonial_average_rating takes all the testimonials that have a rating and calculates the average.

    All the best,
    Mihaela

    Thread Starter Onno454

    (@onno454)

    Thanks Mihaela
    When using do_shortcode in PHP it shows the value, but also HTML div’s/span’s.
    Is there a way to get rid of this HTML to keep only the value, is there maybe a global variable for the count & average that I can use? or another way?
    Thanks again!

    Hello @onno454,

    [testimonial_count] should only display only the value, without any other tags.
    If it does then please try [testimonial_count unformatted]
    And for [testimonial_average_rating] you can use this filter:

    <?php
    ​
    function wpmtst_average_rating_pre_html_filter( $html, $atts, $summary ) {
    	return $summary['rating_average'];
    }
    add_filter('wpmtst_average_rating_pre_html', 'wpmtst_average_rating_pre_html_filter', 10, 3 );

    And it will only display media without other html.

    All the best,
    Mihaela

    Thread Starter Onno454

    (@onno454)

    Thank you Mihaela!
    Works flawless. You’re the greatest!

    Happy to hear it works, @onno454!

    Rock on,
    Mihaela

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Where is the shortcode data stored’ is closed to new replies.