Changeset 23481 for trunk/wp-admin/includes/ajax-actions.php
- Timestamp:
- 02/25/2013 02:32:22 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/ajax-actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r23416 r23481 2082 2082 $response = array(); 2083 2083 2084 // screen id is the same as $current_screen->id and the JS global 'pagenow'2084 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 2085 2085 if ( ! empty($_POST['screenid']) ) 2086 2086 $screen_id = sanitize_key($_POST['screenid']); 2087 2087 else 2088 2088 $screen_id = 'site'; 2089 2089 2090 2090 if ( ! empty($_POST['data']) ) { 2091 2091 $data = wp_unslash( (array) $_POST['data'] ); … … 2107 2107 $response['servertime'] = time(); 2108 2108 2109 // Change the interval, format: array( speed, ticks )2110 if ( isset($response['heartbeat_interval']) )2111 $response['heartbeat_interval'] = (array) $response['heartbeat_interval'];2112 2113 2109 wp_send_json($response); 2114 2110 } 2111 2112 function wp_ajax_nopriv_heartbeat() { 2113 $response = array(); 2114 2115 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 2116 if ( ! empty($_POST['screenid']) ) 2117 $screen_id = sanitize_key($_POST['screenid']); 2118 else 2119 $screen_id = 'site'; 2120 2121 if ( ! empty($_POST['data']) ) { 2122 $data = wp_unslash( (array) $_POST['data'] ); 2123 $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id ); 2124 } 2125 2126 $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id ); 2127 2128 // Allow the transport to be replaced with long-polling easily 2129 do_action( 'heartbeat_nopriv_tick', $response, $screen_id ); 2130 2131 // send the current time acording to the server 2132 $response['servertime'] = time(); 2133 2134 wp_send_json($response); 2135 } 2136
Note: See TracChangeset
for help on using the changeset viewer.