Automattic\WooCommerce\Internal\VariationGallery

ClassicVariationGalleryAdmin::get_count_textprivateWC 1.0

Get the image count label shown beside the field title.

Method of the class: ClassicVariationGalleryAdmin{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_count_text( $count ): string;
$count(int) (required)
Number of images.

ClassicVariationGalleryAdmin::get_count_text() code WC 10.9.1

private function get_count_text( int $count ): string {
	if ( 0 === $count ) {
		return __( 'No images yet', 'woocommerce' );
	}

	return sprintf(
		/* translators: %d number of variation gallery images */
		_n( '%d image', '%d images', $count, 'woocommerce' ),
		$count
	);
}