Changeset 24406 for trunk/wp-admin/includes/ajax-actions.php
- Timestamp:
- 06/05/2013 12:13:40 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r24388 r24406 14 14 15 15 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 16 if ( ! empty($_POST['screen id']) )17 $screen_id = sanitize_key($_POST['screen id']);16 if ( ! empty($_POST['screen_id']) ) 17 $screen_id = sanitize_key($_POST['screen_id']); 18 18 else 19 $screen_id = ' site';19 $screen_id = 'front'; 20 20 21 21 if ( ! empty($_POST['data']) ) { … … 30 30 31 31 // send the current time according to the server 32 $response['server time'] = time();32 $response['server_time'] = time(); 33 33 34 34 wp_send_json($response); … … 2059 2059 2060 2060 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 2061 if ( ! empty($_POST['screen id']) )2062 $screen_id = sanitize_key($_POST['screen id']);2061 if ( ! empty($_POST['screen_id']) ) 2062 $screen_id = sanitize_key($_POST['screen_id']); 2063 2063 else 2064 $screen_id = ' site';2064 $screen_id = 'front'; 2065 2065 2066 2066 if ( ! empty($_POST['data']) ) { 2067 2067 $data = (array) $_POST['data']; 2068 // todo: how much to sanitize and preset and what to leave to be accessed from $data or $_POST..?2069 $user = wp_get_current_user();2070 $data['user_id'] = $user->exists() ? $user->ID : 0;2071 2068 2072 2069 // todo: separate filters: 'heartbeat_[action]' so we call different callbacks only when there is data for them, … … 2081 2078 2082 2079 // send the current time acording to the server 2083 $response['server time'] = time();2080 $response['server_time'] = time(); 2084 2081 2085 2082 wp_send_json($response);
Note: See TracChangeset
for help on using the changeset viewer.