Automattic\WooCommerce\Internal\Admin\ProductReviews
Reviews::get_pending_count_bubble()
Counts the number of pending product reviews/replies, and returns the notification bubble if there's more than zero.
Метод класса: Reviews{}
Хуки из метода
Возвращает
Строку
. Empty string if there are no pending reviews, or bubble HTML if there are.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_pending_count_bubble(): string;
Код Reviews::get_pending_count_bubble() Reviews::get pending count bubble WC 9.8.1
protected function get_pending_count_bubble(): string { $count = (int) get_comments( array( 'type__in' => array( 'review', 'comment' ), 'status' => '0', 'post_type' => 'product', 'count' => true, ) ); /** * Provides an opportunity to alter the pending comment count used within * the product reviews admin list table. * * @since 7.0.0 * * @param array $count Current count of comments pending review. */ $count = apply_filters( 'woocommerce_product_reviews_pending_count', $count ); if ( empty( $count ) ) { return ''; } return ' <span class="awaiting-mod count-' . esc_attr( $count ) . '"><span class="pending-count">' . esc_html( $count ) . '</span></span>'; }