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.
Method of the class: Reviews{}
Hooks from the method
Return
String
. Empty string if there are no pending reviews, or bubble HTML if there are.
Usage
// protected - for code of main (parent) or child class $result = $this->get_pending_count_bubble() : string;
Reviews::get_pending_count_bubble() Reviews::get pending count bubble code WC 8.7.0
protected function get_pending_count_bubble() : string { $count = (int) get_comments( [ 'type__in' => [ '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>'; }