public static function graph_reload() { $roost_settings = self::roost_settings(); $app_key = $roost_settings['appKey']; $app_secret = $roost_settings['appSecret']; $type = $_POST['type']; $range = $_POST['range']; $value = $_POST['value']; $time_offset = $_POST['offset']; $roost_graph_data = Roost_API::get_graph_data($app_key, $app_secret, $type, $range, $value, $time_offset); $roost_graph_data = json_encode($roost_graph_data); echo $roost_graph_data; die; }
public static function graph_reload() { $roost_settings = self::roost_settings(); $app_key = $roost_settings['appKey']; $app_secret = $roost_settings['appSecret']; $type = esc_attr($_POST['type']); $range = esc_attr($_POST['range']); $value = esc_attr($_POST['value']); $time_offset = esc_attr($_POST['offset']); $roost_graph_data = Roost_API::get_graph_data($app_key, $app_secret, $type, $range, $value, $time_offset); wp_send_json($roost_graph_data); }