WordPress at a glance
function is not described

WC_API_Coupons::get_coupons_count() public WC 2.1

Get the total number of coupons

{} It's a method of the class: WC_API_Coupons{}

No Hooks.

Return

Array|WP_Error.

Usage

$WC_API_Coupons = new WC_API_Coupons();
$WC_API_Coupons->get_coupons_count( $filter );
$filter(array)
-

Changelog

Since 2.1 Introduced.

Code of WC_API_Coupons::get_coupons_count() WC 5.0.0

<?php
public function get_coupons_count( $filter = array() ) {

	$query = $this->query_coupons( $filter );

	if ( ! current_user_can( 'read_private_shop_coupons' ) ) {
		return new WP_Error( 'woocommerce_api_user_cannot_read_coupons_count', __( 'You do not have permission to read the coupons count', 'woocommerce' ), array( 'status' => 401 ) );
	}

	return array( 'count' => (int) $query->found_posts );
}