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.

Метод класса: ReviewsCommentsOverrides{}

Хуков нет.

Возвращает

true|false.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->should_display_reviews_moved_notice() : bool;

Код ReviewsCommentsOverrides::should_display_reviews_moved_notice() WC 8.7.0

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;
}