base !== 'edit-comments' ) { return; } $this->maybe_display_reviews_moved_notice(); } /** * May render an admin notice informing the user that reviews were moved to a new page. * * @return void */ protected function maybe_display_reviews_moved_notice() : void { if ( $this->should_display_reviews_moved_notice() ) { $this->display_reviews_moved_notice(); } } /** * Checks if the admin notice informing the user that reviews were moved to a new page should be displayed. * * @return bool */ 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; } /** * Renders an admin notice informing the user that reviews were moved to a new page. * * @return void */ protected function display_reviews_moved_notice() : void { ?>

Reviews.', 'woocommerce' ); ?>

id ) { return $args; } if ( ! empty( $args['post_type'] ) && $args['post_type'] !== 'any' ) { $post_types = (array) $args['post_type']; } else { $post_types = get_post_types(); } $index = array_search( 'product', $post_types ); if ( $index !== false ) { unset( $post_types[ $index ] ); } if ( ! is_array( $args ) ) { $args = []; } $args['post_type'] = $post_types; return $args; } }