Changeset 2143202
- Timestamp:
- 08/21/2019 02:33:11 PM (7 years ago)
- Location:
- team-118group-agent/trunk
- Files:
-
- 3 edited
-
modules/hooks.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
wp-tga-filter.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
team-118group-agent/trunk/modules/hooks.php
r2130319 r2143202 72 72 } 73 73 74 75 add_action('rest_api_init', function () { 76 register_rest_route( 'alog/v1', 'date/(?P<date>[a-zA-Z0-9-]+)',array( 77 'methods' => 'GET', 78 'callback' => 'wtgaf_get_alog_info' 79 )); 80 }); 81 82 function wtgaf_get_alog_info($request) { 83 global $wpdb; 84 85 $date = sanitize_text_field( str_replace('-', '/', $request['date'] ) ); 86 87 $timestamp = strtotime( $date ); 88 89 $date_start = $timestamp; 90 $date_end= $timestamp + ( 24*60*60 ) - 1; 91 92 93 $results = $wpdb->get_results( $wpdb->prepare("SELECT * FROM {$wpdb->prefix}wsal_occurrences WHERE `created_on` BETWEEN %d AND %d", $date_start, $date_end ) ); 94 95 if( count( $results ) > 0 ){ 96 $out_data = array(); 97 foreach( $results as $s_result ){ 98 $results_meta = $wpdb->get_results( $wpdb->prepare("SELECT * FROM {$wpdb->prefix}wsal_metadata WHERE occurrence_id = %d", $s_result->id ) ); 99 $s_result->meta = $results_meta; 100 $out_data[] = (array)$s_result; 101 } 102 103 $response = new WP_REST_Response( $out_data ); 104 $response->set_status(200); 105 106 return $response; 107 108 }else{ 109 $out_data = array( 110 'status' => 'error', 111 'message' => 'No entried found' 112 ); 113 $response = new WP_REST_Response( $out_data ); 114 $response->set_status(404); 115 116 return $response; 117 } 118 119 120 121 ######### 122 123 124 125 126 127 128 } 129 130 74 131 ?> -
team-118group-agent/trunk/readme.txt
r2130325 r2143202 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 Stable tag: 1. 210 Version: 1. 29 Stable tag: 1.3 10 Version: 1.3 11 11 12 12 Outputs Gravity Form Entries into JSON -
team-118group-agent/trunk/wp-tga-filter.php
r2130325 r2143202 3 3 Plugin Name: Team 118GROUP Agent 4 4 Description: Team 118GROUP Web Design Plugin to assist with monitoring your WordPress installation and assisting with system care 5 Version: 1. 25 Version: 1.3 6 6 Author: Team118GROUP 7 7 Author URI: http://www.118group.com 8 Stable tag: 1. 28 Stable tag: 1.3 9 9 */ 10 10 … … 12 12 //ini_set('display_errors', 'On'); 13 13 14 15 14 16 15 17 // core initiation
Note: See TracChangeset
for help on using the changeset viewer.