WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/05/2013 12:13:40 AM (8 years ago)
Author:
azaozz
Message:

Heartbeat: rename some vars/args to make them more intuitive, don't set user_id on every request, see #23216

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r24388 r24406  
    1414
    1515    // screen_id is the same as $current_screen->id and the JS global 'pagenow'
    16     if ( ! empty($_POST['screenid']) )
    17         $screen_id = sanitize_key($_POST['screenid']);
     16    if ( ! empty($_POST['screen_id']) )
     17        $screen_id = sanitize_key($_POST['screen_id']);
    1818    else
    19         $screen_id = 'site';
     19        $screen_id = 'front';
    2020
    2121    if ( ! empty($_POST['data']) ) {
     
    3030
    3131    // send the current time according to the server
    32     $response['servertime'] = time();
     32    $response['server_time'] = time();
    3333
    3434    wp_send_json($response);
     
    20592059
    20602060    // screen_id is the same as $current_screen->id and the JS global 'pagenow'
    2061     if ( ! empty($_POST['screenid']) )
    2062         $screen_id = sanitize_key($_POST['screenid']);
     2061    if ( ! empty($_POST['screen_id']) )
     2062        $screen_id = sanitize_key($_POST['screen_id']);
    20632063    else
    2064         $screen_id = 'site';
     2064        $screen_id = 'front';
    20652065
    20662066    if ( ! empty($_POST['data']) ) {
    20672067        $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;
    20712068
    20722069        // todo: separate filters: 'heartbeat_[action]' so we call different callbacks only when there is data for them,
     
    20812078
    20822079    // send the current time acording to the server
    2083     $response['servertime'] = time();
     2080    $response['server_time'] = time();
    20842081
    20852082    wp_send_json($response);
Note: See TracChangeset for help on using the changeset viewer.