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

git-svn-id: https://develop.svn.wordpress.org/trunk@24406 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2013-06-05 00:13:40 +00:00
parent e802145548
commit 22f855d84e
4 changed files with 26 additions and 29 deletions

View File

@@ -569,8 +569,8 @@ add_action('admin_head', '_ipad_meta');
function wp_check_locked_posts( $response, $data, $screen_id ) {
$checked = array();
if ( 'edit-post' == $screen_id && array_key_exists( 'wp-check-locked', $data ) && is_array( $data['wp-check-locked'] ) ) {
foreach ( $data['wp-check-locked'] as $key ) {
if ( 'edit-post' == $screen_id && array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
foreach ( $data['wp-check-locked-posts'] as $key ) {
$post_id = (int) substr( $key, 5 );
if ( current_user_can( 'edit_post', $post_id ) && ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {
@@ -585,7 +585,7 @@ function wp_check_locked_posts( $response, $data, $screen_id ) {
}
if ( ! empty( $checked ) )
$response['wp-check-locked'] = $checked;
$response['wp-check-locked-posts'] = $checked;
return $response;
}
@@ -601,10 +601,10 @@ function wp_refresh_post_lock( $response, $data, $screen_id ) {
$received = $data['wp-refresh-post-lock'];
$send = array();
if ( !$post_id = absint( $received['post_id'] ) )
if ( ! $post_id = absint( $received['post_id'] ) )
return $response;
if ( !current_user_can('edit_post', $post_id) )
if ( ! current_user_can('edit_post', $post_id) )
return $response;
if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {