Changeset 19052 for trunk/wp-admin/post.php
- Timestamp:
- 10/24/2011 06:34:08 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r18796 r19052 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']; 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 } 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 else 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
Note:
See TracChangeset
for help on using the changeset viewer.