Remove Schema markup from Star Rating Widget
-
We would like to remove schema markup from the star rating widget but we don’t know where to start. In the plugin files, we found the code below:
protected function render() { $settings = $this->get_settings_for_display(); $rating_data = $this->get_rating(); $textual_rating = $rating_data[0] . '/' . $rating_data[1]; $icon = ''; if ( 'star_fontawesome' === $settings['star_style'] ) { if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = ''; } } elseif ( 'star_unicode' === $settings['star_style'] ) { $icon = '★'; if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = '☆'; } } $this->add_render_attribute( 'icon_wrapper', [ 'class' => 'elementor-star-rating', 'title' => $textual_rating, 'itemtype' => 'https://schema.org/Rating', 'itemscope' => '', 'itemprop' => 'reviewRating', ] ); $schema_rating = '<span itemprop="ratingValue" class="elementor-screen-only">' . $textual_rating . '</span>'; $stars_element = '<div ' . $this->get_render_attribute_string( 'icon_wrapper' ) . '>' . $this->render_stars( $icon ) . ' ' . $schema_rating . '</div>'; ?> <div class="elementor-star-rating__wrapper"> <?php if ( ! Utils::is_empty( $settings['title'] ) ) : ?> <div class="elementor-star-rating__title"><?php echo esc_html( $settings['title'] ); ?></div> <?php endif; // PHPCS - $stars_element contains an HTML string that cannot be escaped. ?> <?php echo $stars_element; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </div> <?php }
Basically, we are looking to get rid of the itemtype, itemscope, and itemprop markup as we are building our own custom schema. Anyway to overide this with ouw own code?
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Remove Schema markup from Star Rating Widget’ is closed to new replies.