testing progress

This commit is contained in:
2025-08-12 14:46:30 -07:00
parent f6429110e5
commit a5f6ab8b64
3 changed files with 0 additions and 44 deletions

View File

@@ -1488,7 +1488,6 @@ class TWP_Admin {
</td>
<td>
<button class="button" onclick="editWorkflow(<?php echo $workflow->id; ?>)">Edit</button>
<button class="button" onclick="testWorkflow(<?php echo $workflow->id; ?>)">Test</button>
<button class="button" onclick="deleteWorkflow(<?php echo $workflow->id; ?>)">Delete</button>
</td>
</tr>
@@ -2970,29 +2969,6 @@ class TWP_Admin {
wp_send_json_success(array('success' => $result));
}
/**
* AJAX handler for test call
*/
public function ajax_test_call() {
check_ajax_referer('twp_ajax_nonce', 'nonce');
if (!current_user_can('manage_options')) {
wp_die('Unauthorized');
}
$to_number = sanitize_text_field($_POST['to_number']);
$workflow_id = intval($_POST['workflow_id']);
$twilio = new TWP_Twilio_API();
$twiml_url = home_url('/wp-json/twilio-webhook/v1/voice');
$twiml_url = add_query_arg('workflow_id', $workflow_id, $twiml_url);
$result = $twilio->make_call($to_number, $twiml_url);
wp_send_json_success($result);
}
/**
* AJAX handler for getting phone numbers
*/