Automattic\WooCommerce\Internal\Admin\ProductReviews
ReviewsCommentsOverrides::should_display_reviews_moved_notice
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.
Returns
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() ReviewsCommentsOverrides::should display reviews moved notice code WC 10.3.3
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;
}