0, 'stars' => '1', 'average' => '1', 'count' => '1', ), $atts, 'omorev_rating' ); $post_id = (int) $atts['id'] ?: get_the_ID(); return omoreviews_get_rating_badge( $post_id, array( 'show_stars' => '1' === (string) $atts['stars'], 'show_average' => '1' === (string) $atts['average'], 'show_count' => '1' === (string) $atts['count'], ) ); } /** * [omorev_count id="123"] — فقط تعداد نظرات */ public function count( $atts ) { $atts = shortcode_atts( array( 'id' => 0 ), $atts, 'omorev_count' ); $post_id = (int) $atts['id'] ?: get_the_ID(); return esc_html( number_format_i18n( omoreviews_get_count( $post_id ) ) ); } /** * [omorev_average id="123"] — فقط میانگین امتیاز */ public function average( $atts ) { $atts = shortcode_atts( array( 'id' => 0 ), $atts, 'omorev_average' ); $post_id = (int) $atts['id'] ?: get_the_ID(); return esc_html( number_format_i18n( omoreviews_get_average( $post_id ), 1 ) ); } public function render( $atts ) { $atts = shortcode_atts( array( 'id' => 0 ), $atts, 'omorev_reviews' ); $post_id = (int) $atts['id']; if ( ! $post_id ) { $post_id = get_the_ID(); } if ( ! $post_id ) { return ''; } return OmoRev_Public::render( $post_id ); } }