diff --git a/inc/models/class-customer.php b/inc/models/class-customer.php index 22a16be0..01ef9634 100644 --- a/inc/models/class-customer.php +++ b/inc/models/class-customer.php @@ -813,6 +813,12 @@ public function set_type($type) { */ public function get_total_grossed() { + $pre = apply_filters( 'wu_pre_customer_get_total_grossed', null, $this ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; static $sum; diff --git a/inc/models/class-domain.php b/inc/models/class-domain.php index cac48875..4a921709 100644 --- a/inc/models/class-domain.php +++ b/inc/models/class-domain.php @@ -610,6 +610,12 @@ public function delete() { */ public static function get_by_site($site) { + $pre = apply_filters( 'wu_pre_domain_get_by_site', null, $site ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; // Allow passing a site object in diff --git a/inc/models/class-membership.php b/inc/models/class-membership.php index a386b595..0b4be1bb 100644 --- a/inc/models/class-membership.php +++ b/inc/models/class-membership.php @@ -2320,6 +2320,12 @@ public function set_recurring($recurring): void { */ public function get_total_grossed() { + $pre = apply_filters( 'wu_pre_membership_get_total_grossed', null, $this ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; static $sum; diff --git a/inc/models/class-site.php b/inc/models/class-site.php index a40acf2c..83b0d714 100644 --- a/inc/models/class-site.php +++ b/inc/models/class-site.php @@ -1158,6 +1158,12 @@ public function get_membership() { return $this->membership; } + $pre = apply_filters( 'wu_pre_site_get_membership', null, $this ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; $table_name = "{$wpdb->base_prefix}wu_memberships"; @@ -2226,6 +2232,12 @@ public function to_search_results() { */ public static function get_all_by_type($type = 'customer_owned', $query_args = []) { + $pre = apply_filters( 'wu_pre_site_get_all_by_type', null, $type, $query_args ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; if ('pending' === $type) { @@ -2318,6 +2330,12 @@ public static function get_all_by_categories($categories = [], $query_args = []) */ public static function get_all_categories($sites = []) { + $pre = apply_filters( 'wu_pre_site_get_all_categories', null, $sites ); + + if ( null !== $pre ) { + return $pre; + } + global $wpdb; $site_ids = [];