MP_Addon_CalculatorsCallRail_Webhook::add_calls( int $post_id, array $new_call )
Add call to calls metabox.
Contents
Parameters Parameters
- $post_id
-
(int) (Required) callrail post ID
- $new_call
-
(array) (Required) Call data.
- ''start_time''
(string) - ''customer_phone_number''
(string) - ''formatted_call_type''
(string) - ''recording''
(string) - ''formatted_duration''
(string) - ''conversational_transcript''
(string) - ''agent_email''
(string) - ''device_type''
(string) - ''call_highlights''
(string) - ''resource_id''
(string) - ''id''
(string) - ''note''
(string) - ''formatted_tracking_source''
(string) - ''source_name''
(string) - ''tags''
(string) - ''keywords''
(string) - ''referring_url''
(string) - ''landing_page_url''
(string) - ''last_requested_url''
(string) - ''referrer_domain''
(string) - ''keywords_spotted''
(string) - ''keypad_entries''
(string)
- ''start_time''
Source Source
File: calculator-callrail-add-on/inc/MP_Addon_CalculatorsCallRail_Webhook.php
protected function add_calls( $post_id, $new_call ) {
$calls = get_post_meta( $post_id, MortgagePlatform::$prefix . 'callrail_calls', false );
$id = false;
foreach ( $calls as $call ) {
if ( $call['resource_id'] === $new_call['resource_id'] ) {
update_post_meta( $post_id, MortgagePlatform::$prefix . 'callrail_calls', $new_call, $call );
$id = true;
}
}
if ( ! $id ) {
add_post_meta( $post_id, MortgagePlatform::$prefix . 'callrail_calls', $new_call, false );
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |