• 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)
  • Plugin Support vipul78

    (@vipulelementor)

    Hi there

    Since this is a development-based query, may opt to visit our Github account where you may get in contact with a member of our development team to query this with.

    Please note that this is not an official support channel but a respective member of the development team will respond to your post as soon as they are available.

    Please follow this guide which outlines the steps required to post on our Github: https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Schema markup from Star Rating Widget’ is closed to new replies.