Changeset 24408
- Timestamp:
- 06/05/2013 03:01:59 AM (11 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/misc.php
r24406 r24408 570 570 $checked = array(); 571 571 572 if ( 'edit-post' == $screen_id &&array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {572 if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) { 573 573 foreach ( $data['wp-check-locked-posts'] as $key ) { 574 $post_id = (int) substr( $key, 5 ); 575 576 if ( current_user_can( 'edit_post', $post_id ) && ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) { 574 if ( ! $post_id = absint( substr( $key, 5 ) ) ) 575 continue; 576 577 if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) && current_user_can( 'edit_post', $post_id ) ) { 577 578 $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) ); 578 579 … … 598 599 */ 599 600 function wp_refresh_post_lock( $response, $data, $screen_id ) { 600 if ( 'post' == $screen_id &&array_key_exists( 'wp-refresh-post-lock', $data ) ) {601 if ( array_key_exists( 'wp-refresh-post-lock', $data ) ) { 601 602 $received = $data['wp-refresh-post-lock']; 602 603 $send = array(); … … 637 638 */ 638 639 function wp_refresh_post_nonces( $response, $data, $screen_id ) { 639 if ( 'post' == $screen_id &&array_key_exists( 'wp-refresh-post-nonces', $data ) ) {640 if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) { 640 641 $received = $data['wp-refresh-post-nonces']; 641 642 -
trunk/wp-admin/includes/post.php
r24388 r24408 1203 1203 } 1204 1204 1205 if ( $locked && ( $sendback = wp_get_referer() ) && 1206 false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) { 1207 1208 $sendback_text = __('Go back'); 1209 } else { 1210 $sendback = admin_url( 'edit.php' ); 1211 1212 if ( 'post' != $post->post_type && ( $post_type_object = get_post_type_object( $post->post_type ) ) ) { 1213 $sendback .= '?post_type=' . $post->post_type; 1214 $sendback_text = sprintf( _x('Go to All %s', 'post type general name: Posts, Pages, etc.'), $post_type_object->labels->name ); 1215 } else { 1216 $sendback_text = __('Go to All Posts'); 1217 } 1218 } 1219 1205 1220 $hidden = $locked ? '' : ' hidden'; 1206 1221 … … 1230 1245 <?php do_action( 'post_lock_text', $post ); ?> 1231 1246 <p> 1232 <a class="button" href="<?php echo esc_url( wp_get_referer() ); ?>"><?php _e('Go back'); ?></a>1247 <a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a> 1233 1248 <a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e('Preview'); ?></a> 1234 1249 <?php … … 1255 1270 </p> 1256 1271 <?php do_action( 'post_lock_text', $post ); ?> 1257 <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( admin_url('edit.php') ); ?>"><?php _e('Go to All Posts'); ?></a></p>1272 <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a></p> 1258 1273 </div> 1259 1274 <?php
Note: See TracChangeset
for help on using the changeset viewer.