Changeset 23725 for trunk/wp-admin/includes/post.php
- Timestamp:
- 03/15/2013 09:09:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r23661 r23725 1199 1199 */ 1200 1200 function _admin_notice_post_locked() { 1201 global $post_ID; 1202 1203 if ( !empty( $post_ID ) && ( $user = wp_check_post_lock( $post_ID ) ) ) { 1201 if ( ! $post = get_post() ) 1202 return; 1203 1204 if ( $user = wp_check_post_lock( $post->ID ) ) { 1204 1205 $user = get_userdata( $user ); 1205 $locked = apply_filters( 'show_post_locked_dialog', true, $post _ID, $user );1206 $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user ); 1206 1207 } else { 1207 1208 $locked = false; 1208 1209 } 1209 1210 1211 $class = $locked ? '' : ' class="hidden"'; 1212 1210 1213 ?> 1211 <div id="notification-dialog-wrap"<?php if ( ! $locked ) echo ' style="display:none"'; ?>>1214 <div id="notification-dialog-wrap"<?php echo $class; ?>> 1212 1215 <div id="notification-dialog-background"></div> 1213 1216 <div id="notification-dialog"> … … 1215 1218 1216 1219 if ( $locked ) { 1220 $preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ); 1221 1222 if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) { 1223 // Latest content is in autosave 1224 $nonce = wp_create_nonce( 'post_preview_' . $post->ID ); 1225 $preview_link = add_query_arg( array( 'preview_id' => $post->ID, 'preview_nonce' => $nonce ), $preview_link ); 1226 } 1227 1228 $preview_link = apply_filters( 'preview_post_link', $preview_link ); 1229 1217 1230 ?> 1218 1231 <div class="post-locked-message"> … … 1221 1234 <p> 1222 1235 <a class="button" href="<?php echo esc_url( wp_get_referer() ); ?>"><?php _e('Go back'); ?></a> 1236 <a class="button" href="<?php echo esc_url( $preview_link ); ?>"><?php _e('Preview'); ?></a> 1223 1237 <?php 1224 1238 1225 // Allow plugins to prevent some users taking over1226 if ( apply_filters( ' post_lock_take_over', true, $post_ID, $user ) ) {1239 // Allow plugins to prevent some users overriding the post lock 1240 if ( apply_filters( 'override_post_lock', true, $post, $user ) ) { 1227 1241 ?> 1228 <a class="button button-primary" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', get_edit_post_link( $post _ID, 'url' ) ) ); ?>"><?php _e('Take over'); ?></a>1242 <a class="button button-primary" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', get_edit_post_link( $post->ID, 'url' ) ) ); ?>"><?php _e('Take over'); ?></a> 1229 1243 <?php 1230 1244 }
Note: See TracChangeset
for help on using the changeset viewer.