-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathclass.api.php
More file actions
25 lines (24 loc) · 789 Bytes
/
class.api.php
File metadata and controls
25 lines (24 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
if(!defined('ABSPATH')) { exit; }
if( !class_exists( 'EDW_API' ) ) {
class EDW_API {
function __construct() {
add_action( 'wp_ajax_nopriv_edw_get_estimate_dates', array($this, 'edw_get_estimate_dates') );
add_action( 'wp_ajax_edw_get_estimate_dates', array($this, 'edw_get_estimate_dates') );
}
function edw_get_estimate_dates() {
global $EDWCore;
$product = sanitize_text_field( $_POST['product'] );
$string = $EDWCore->edw_show_message($product);
if(!$string) {
$res = array();
}else{
$res = array('html' => $string);
}
wp_send_json($res);
wp_die();
}
}
$EDW_API = new EDW_API();
}
?>