# tier-pricing-table/8.1.0/src/Addons/GlobalTieredPricing/CPT/GlobalRulesQuery.php

Tiered Pricing Table for WooCommerce, version 8.1.0. 40 lines.

- Page: https://pluginprobe.com/plugins/tier-pricing-table/8.1.0/code/src/Addons/GlobalTieredPricing/CPT/GlobalRulesQuery.php
- Raw: https://pluginprobe.com/plugins/tier-pricing-table/8.1.0/raw/src/Addons/GlobalTieredPricing/CPT/GlobalRulesQuery.php
- Modified: 2026-10-07T10:44:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tier-pricing-table/8.1.0/code/src/Addons/GlobalTieredPricing/CPT/GlobalRulesQuery.php#L10-L20`.

```php
<?php namespace TierPricingTable\Addons\GlobalTieredPricing\CPT;

/**
 * Query arguments for the global pricing rules that take part in pricing.
 */
class GlobalRulesQuery {

	/**
	 * Published rules that are not suspended.
	 *
	 * A "!=" comparison alone would also drop every rule without a "_tpt_is_suspended" row (rules
	 * created before the suspend action existed and not saved since), because the comparison needs
	 * the meta row to exist. Rules without the row are active.
	 *
	 * @param  string  $postType  The rules' post type.
	 *
	 * @return array get_posts() arguments.
	 */
	public static function args( string $postType ): array {
		return array(
			'numberposts' => - 1,
			'post_type'   => $postType,
			'post_status' => 'publish',
			'fields'      => 'ids',
			'meta_query'  => array(
				'relation' => 'OR',
				array(
					'key'     => '_tpt_is_suspended',
					'compare' => 'NOT EXISTS',
				),
				array(
					'key'     => '_tpt_is_suspended',
					'value'   => 'yes',
					'compare' => '!=',
				),
			),
		);
	}
}

```
