} /** * Get the count, if displaying. * * @param object $category Term object. * @param array $attributes Block attributes. Default empty array. * @return string */ protected function getCount( $category, $attributes ) { if ( empty( $attributes['hasCount'] ) ) { return ''; } if ( $attributes['isDropdown'] ) { return '(' . absint( $category->count ) . ')'; } $screen_reader_text = sprintf( /* translators: %s number of products in cart. */ _n( '%d product', '%d products', absint( $category->count ), 'woocommerce' ), absint( $category->count ) ); return '' . '' . '' . esc_html( $screen_reader_text ) . '' . ''; } }