Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsCommentsOverrides::display_reviews_moved_notice()protectedWC 1.0

Renders an admin notice informing the user that reviews were moved to a new page.

Method of the class: ReviewsCommentsOverrides{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->display_reviews_moved_notice() : void;

ReviewsCommentsOverrides::display_reviews_moved_notice() code WC 7.1.0

<?php
protected function display_reviews_moved_notice() : void {
	$dismiss_url = wp_nonce_url(
		add_query_arg(
			[
				'wc-hide-notice' => urlencode( static::REVIEWS_MOVED_NOTICE_ID ),
			]
		),
		'woocommerce_hide_notices_nonce',
		'_wc_notice_nonce'
	);
	?>

	<div class="notice notice-info is-dismissible">
		<p><strong><?php esc_html_e( 'Product reviews have moved!', 'woocommerce' ); ?></strong></p>
		<p><?php esc_html_e( 'Product reviews can now be managed from Products > Reviews.', 'woocommerce' ); ?></p>
		<p class="submit">
			<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=product&page=product-reviews' ) ); ?>" class="button-primary"><?php esc_html_e( 'Visit new location', 'woocommerce' ); ?></a>
		</p>
		<button type="button" class="notice-dismiss" onclick="window.location = '<?php echo esc_url( $dismiss_url ); ?>';"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'woocommerce' ); ?></span></button>
	</div>

	<?php
}