Changes in trunk/wp-admin/post.php [17962:19272]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r17962 r19272 17 17 wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); 18 18 19 if ( isset( $_GET['post']) )20 $post_id= (int) $_GET['post'];21 elseif ( isset( $_POST['post_ID']) )22 $post_id= (int) $_POST['post_ID'];19 if ( isset( $_GET['post'] ) ) 20 $post_id = $post_ID = (int) $_GET['post']; 21 elseif ( isset( $_POST['post_ID'] ) ) 22 $post_id = $post_ID = (int) $_POST['post_ID']; 23 23 else 24 $post_id = 0; 25 $post_ID = $post_id; 26 $post = null; 27 $post_type_object = null; 28 $post_type = null; 29 if ( $post_id ) { 30 $post = get_post($post_id); 31 if ( $post ) { 32 $post_type_object = get_post_type_object($post->post_type); 33 if ( $post_type_object ) { 34 $post_type = $post->post_type; 35 $current_screen->post_type = $post->post_type; 36 $current_screen->id = $current_screen->post_type; 37 } 38 } 39 } elseif ( isset($_POST['post_type']) ) { 40 $post_type_object = get_post_type_object($_POST['post_type']); 41 if ( $post_type_object ) { 42 $post_type = $post_type_object->name; 43 $current_screen->post_type = $post_type; 44 $current_screen->id = $current_screen->post_type; 45 } 24 $post_id = $post_ID = 0; 25 26 $post = $post_type = $post_type_object = null; 27 28 if ( $post_id ) 29 $post = get_post( $post_id ); 30 31 if ( $post ) { 32 $post_type = $post->post_type; 33 $post_type_object = get_post_type_object( $post_type ); 46 34 } 47 35 … … 95 83 96 84 $sendback = wp_get_referer(); 97 if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false ) { 98 $sendback = admin_url('edit.php'); 99 $sendback .= ( !empty( $post_type ) ) ? '?post_type=' . $post_type : ''; 85 if ( ! $sendback || 86 strpos( $sendback, 'post.php' ) !== false || 87 strpos( $sendback, 'post-new.php' ) !== false ) { 88 $sendback = admin_url( 'edit.php' ); 89 $sendback .= ( ! empty( $post_type ) ) ? '?post_type=' . $post_type : ''; 100 90 } else { 101 91 $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback ); … … 115 105 $_POST['comment_status'] = get_option('default_comment_status'); 116 106 $_POST['ping_status'] = get_option('default_ping_status'); 117 }118 119 if ( !empty( $_POST['quickpress_post_ID'] ) ) {120 $_POST['post_ID'] = (int) $_POST['quickpress_post_ID'];121 107 $post_id = edit_post(); 122 108 } else { … … 175 161 add_action('admin_notices', '_admin_notice_post_locked' ); 176 162 } else { 177 wp_set_post_lock( $post->ID );163 $active_post_lock = wp_set_post_lock( $post->ID ); 178 164 wp_enqueue_script('autosave'); 179 165 }
Note: See TracChangeset
for help on using the changeset viewer.