Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsCommentsOverrides::should_display_reviews_moved_notice()protectedWC 1.0

Checks if the admin notice informing the user that reviews were moved to a new page should be displayed.

Method of the class: ReviewsCommentsOverrides{}

No Hooks.

Return

true|false.

Usage

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

ReviewsCommentsOverrides::should_display_reviews_moved_notice() code WC 9.4.2

protected function should_display_reviews_moved_notice() : bool {
	// Do not display if the user does not have the capability  to see the new page.
	if ( ! WC()->call_function( 'current_user_can', Reviews::get_capability() ) ) {
		return false;
	}

	// Do not display if the current user has dismissed this notice.
	if ( WC()->call_function( 'get_user_meta', get_current_user_id(), 'dismissed_' . static::REVIEWS_MOVED_NOTICE_ID . '_notice', true ) ) {
		return false;
	}

	return true;
}