| @@ -208,8 +208,11 @@ | ||
| 208 | 208 | ], |
| 209 | 209 | ] |
| 210 | 210 | ); |
| 211 | 211 | |
| 212 | + $start = is_rtl() ? 'right' : 'left'; | |
| 213 | + $end = ! is_rtl() ? 'right' : 'left'; | |
| 214 | + | |
| 212 | 215 | $this->add_responsive_control( |
| 213 | 216 | 'align', |
| 214 | 217 | [ |
| 215 | 218 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| @@ -216,9 +219,9 @@ | ||
| 216 | 219 | 'type' => Controls_Manager::CHOOSE, |
| 217 | 220 | 'options' => [ |
| 218 | 221 | 'start' => [ |
| 219 | 222 | 'title' => esc_html__( 'Start', 'elementor' ), |
| 220 | - 'icon' => 'eicon-text-align-left', | |
| 223 | + 'icon' => "eicon-text-align-$start", | |
| 221 | 224 | ], |
| 222 | 225 | 'center' => [ |
| 223 | 226 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 224 | 227 | 'icon' => 'eicon-text-align-center', |
| @@ -224,9 +227,9 @@ | ||
| 224 | 227 | 'icon' => 'eicon-text-align-center', |
| 225 | 228 | ], |
| 226 | 229 | 'end' => [ |
| 227 | 230 | 'title' => esc_html__( 'End', 'elementor' ), |
| 228 | - 'icon' => 'eicon-text-align-right', | |
| 231 | + 'icon' => "eicon-text-align-$end", | |
| 229 | 232 | ], |
| 230 | 233 | 'justify' => [ |
| 231 | 234 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| 232 | 235 | 'icon' => 'eicon-text-align-justify', |
| @@ -231,9 +234,8 @@ | ||
| 231 | 234 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| 232 | 235 | 'icon' => 'eicon-text-align-justify', |
| 233 | 236 | ], |
| 234 | 237 | ], |
| 235 | - 'classes' => 'elementor-control-start-end', | |
| 236 | 238 | 'classes_dictionary' => [ |
| 237 | 239 | 'left' => is_rtl() ? 'end' : 'start', |
| 238 | 240 | 'right' => is_rtl() ? 'start' : 'end', |
| 239 | 241 | ], |
| @@ -411,9 +413,9 @@ | ||
| 411 | 413 | */ |
| 412 | 414 | protected function get_rating() { |
| 413 | 415 | $settings = $this->get_settings_for_display(); |
| 414 | 416 | $rating_scale = (int) $settings['rating_scale']; |
| 415 | - $rating = min( (float) $settings['rating'], $rating_scale ); | |
| 417 | + $rating = (float) $settings['rating'] > $rating_scale ? $rating_scale : $settings['rating']; | |
| 416 | 418 | |
| 417 | 419 | return [ $rating, $rating_scale ]; |
| 418 | 420 | } |
| 419 | 421 | |
| @@ -442,9 +444,9 @@ | ||
| 442 | 444 | $stars_html .= '<i class="elementor-star-empty" aria-hidden="true">' . $icon . '</i>'; |
| 443 | 445 | } |
| 444 | 446 | } |
| 445 | 447 | |
| 446 | - Utils::print_unescaped_internal_string( $stars_html ); | |
| 448 | + return $stars_html; | |
| 447 | 449 | } |
| 448 | 450 | |
| 449 | 451 | /** |
| 450 | 452 | * @since 2.3.0 |
| @@ -484,9 +486,9 @@ | ||
| 484 | 486 | <?php if ( ! Utils::is_empty( $settings['title'] ) ) : ?> |
| 485 | 487 | <div class="elementor-star-rating__title"><?php echo esc_html( $settings['title'] ); ?></div> |
| 486 | 488 | <?php endif; ?> |
| 487 | 489 | <div <?php $this->print_render_attribute_string( 'icon_wrapper' ); ?>> |
| 488 | - <?php $this->render_stars( $icon ); ?> | |
| 490 | + <?php echo $this->render_stars( $icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | |
| 489 | 491 | <span itemprop="ratingValue" class="elementor-screen-only"><?php echo esc_html( $textual_rating ); ?></span> |
| 490 | 492 | </div> |
| 491 | 493 | </div> |
| 492 | 494 | <?php |