MP_Reports::get_all_age()
Get array age of leads.
Return Return
(array)
Source Source
File: mortgage-platform/Inc/Callback/MP_Reports.php
public function get_all_age() {
$leads = $this->get_all_leads( array( MortgagePlatform::$lead, MortgagePlatform::$abandoned_lead ) );
$age = array();
foreach ( $leads as $lead ) {
if ( get_post_type( $lead ) === MortgagePlatform::$lead ) {
$l_lead = __( 'Lead', 'mortgage_platform' );
$year_of_birth = get_post_meta( $lead, MortgagePlatform::$prefix . 'lead_yearofbirth' );
if ( ! empty( $year_of_birth[0] ) ) {
$l_age = (int) gmdate( 'Y' ) - (int) $year_of_birth[0];
array_push( $age, array( $l_lead, $l_age ) );
}
}
if ( get_post_type( $lead ) === MortgagePlatform::$abandoned_lead ) {
$ab_lead = __( 'Abandoned Lead', 'mortgage_platform' );
$ab_year_of_birth = get_post_meta( $lead, MortgagePlatform::$prefix . 'abandoned_lead_yearofbirth' );
if ( ! empty( $ab_year_of_birth[0] ) ) {
$ab_age = (int) gmdate( 'Y' ) - (int) $ab_year_of_birth[0];
array_push( $age, array( $ab_lead, $ab_age ) );
}
}
}
return $age;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |