Automattic\WooCommerce\Blocks\BlockTypes\Reviews

ProductReviewsPaginationNext::get_pagination_arrowprotectedWC 1.0

Get the pagination arrow.

Method of the class: ProductReviewsPaginationNext{}

No Hooks.

Returns

String|null.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_pagination_arrow( $block );
$block(WP_Block) (required)
Block instance.

ProductReviewsPaginationNext::get_pagination_arrow() code WC 10.7.0

protected function get_pagination_arrow( $block ) {
	$arrow_map = array(
		'none'    => '',
		'arrow'   => '→',
		'chevron' => '»',
	);
	if ( ! empty( $block->context['reviews/paginationArrow'] ) && ! empty( $arrow_map[ $block->context['reviews/paginationArrow'] ] ) ) {
		$arrow_attribute = $block->context['reviews/paginationArrow'];
		$arrow           = $arrow_map[ $block->context['reviews/paginationArrow'] ];
		$arrow_classes   = "wp-block-woocommerce-product-reviews-pagination-next-arrow is-arrow-$arrow_attribute";
		return "<span class='$arrow_classes' aria-hidden='true'>$arrow</span>";
	}
	return null;
}