WC_Privacy::delete_inactive_accounts()public staticWC 3.4.0

Delete inactive accounts.

Method of the class: WC_Privacy{}

No Hooks.

Return

Int. Number of users processed.

Usage

$result = WC_Privacy::delete_inactive_accounts( $limit );
$limit(int)
Limit users to process per batch.
Default: 20

Changelog

Since 3.4.0 Introduced.

WC_Privacy::delete_inactive_accounts() code WC 8.7.0

public static function delete_inactive_accounts( $limit = 20 ) {
	$option = wc_parse_relative_date_option( get_option( 'woocommerce_delete_inactive_accounts' ) );

	if ( empty( $option['number'] ) ) {
		return 0;
	}

	return self::delete_inactive_accounts_query( strtotime( '-' . $option['number'] . ' ' . $option['unit'] ), $limit );
}