Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

MP_Addon_Google_Spreadsheets::prepare_lead_data( array $lead_data )

Prepare lead data to JSON.


Parameters Parameters

$lead_data

(array) (Required) lead data


Top ↑

Return Return

(false|string) Lead data in JSON { Lead data. @type string 'firstname' lead first name @type string 'secondname' lead second name @type string 'email' lead email @type string 'phone' lead phone @type string 'zipcode' lead zip code @type string 'yearofbirth' lead year of birth @type string 'investmentamount' investment amount }


Top ↑

Source Source

File: calculator-google-spreadsheets-add-on/inc/MP_Addon_Google_Spreadsheets.php

	private function prepare_lead_data( $lead_data ) {

		$data = array(
			isset( $lead_data['firstname'] ) ? sanitize_text_field($lead_data['firstname']) : "",
			isset( $lead_data['secondname'] ) ? sanitize_text_field($lead_data['secondname']) : "",
			isset( $lead_data['email'] ) ? sanitize_text_field($lead_data['email']) : "",
			isset( $lead_data['phone'] ) ? sanitize_text_field($lead_data['phone']) : "",
			isset( $lead_data['zipcode'] ) ? sanitize_text_field($lead_data['zipcode']) : "",
			isset( $lead_data['yearofbirth'] ) ? sanitize_text_field($lead_data['yearofbirth']) : "",
			isset( $lead_data['investmentamount'] ) ? $this->get_invest_amount($lead_data['investmentamount']) : "",
		);

		/**
		 * Action google spreadsheets data.
		 * @since 1.0.0
		 *
		 * @param array $data {
		 *   Lead data.
		 *
		 *  @type string 'firstname' lead first name
		 *  @type string 'secondname' lead second name
		 *  @type string 'email' lead email
		 *  @type string 'phone' lead phone
		 *  @type string 'zipcode' lead zip code
		 *  @type string 'yearofbirth' lead year of birth
		 *  @type string 'investmentamount' investment amount
		 *
		 * }
		 */
		do_action('google_spreadsheets_data',$data);

		return $data;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.