Changeset 15452 for branches/3.0/wp-admin/includes/post.php
- Timestamp:
- 07/21/2010 08:10:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-admin/includes/post.php
r15451 r15452 1173 1173 */ 1174 1174 function wp_check_post_lock( $post_id ) { 1175 global $current_user;1176 1177 1175 if ( !$post = get_post( $post_id ) ) 1178 1176 return false; … … 1183 1181 $time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ); 1184 1182 1185 if ( $lock && $lock > time() - $time_window && $last != $current_user->ID)1183 if ( $lock && $lock > time() - $time_window && $last != get_current_user_id() ) 1186 1184 return $last; 1187 1185 return false; … … 1197 1195 */ 1198 1196 function wp_set_post_lock( $post_id ) { 1199 global $current_user;1200 1197 if ( !$post = get_post( $post_id ) ) 1201 1198 return false; 1202 if ( !$current_user || !$current_user->ID)1199 if ( 0 == get_current_user_id() ) 1203 1200 return false; 1204 1201 … … 1255 1252 $new_autosave = _wp_post_revision_fields( $_POST, true ); 1256 1253 $new_autosave['ID'] = $old_autosave->ID; 1257 $current_user = wp_get_current_user(); 1258 $new_autosave['post_author'] = $current_user->ID; 1254 $new_autosave['post_author'] = get_current_user_id(); 1259 1255 return wp_update_post( $new_autosave ); 1260 1256 }
Note: See TracChangeset
for help on using the changeset viewer.