MP_Reports::get_searches( array $leads, string $post_type )

Gets the number of repeated calculate.


Parameters Parameters

$leads

(array) (Required) leads

$post_type

(string) (Required) post type


Top ↑

Return Return

(int)


Top ↑

Source Source

File: mortgage-platform/Inc/Callback/MP_Reports.php

	public function get_searches( $leads, $post_type ) {

		$count = 0;
		$meta  = array();
		foreach ( $leads as $lead ) {
			if ( MortgagePlatform::$lead === $post_type ) {
				$meta = get_post_meta( $lead, MortgagePlatform::$prefix . 'lead_searches' );
			}
			if ( MortgagePlatform::$abandoned_lead === $post_type ) {
				$meta = get_post_meta( $lead, MortgagePlatform::$prefix . 'abandoned_lead_searches' );
			}

			foreach ( $meta as $index ) {
				if ( $index['calculate_date'] ) {
					$count ++;
				}
			}
		}

		return $count;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.