]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/post-new.php
Wordpress 3.2
[autoinstalls/wordpress.git] / wp-admin / post-new.php
1 <?php
2 /**
3  * New Post Administration Screen.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /** Load WordPress Administration Bootstrap */
10 require_once('./admin.php');
11
12 if ( !isset($_GET['post_type']) )
13         $post_type = 'post';
14 elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
15         $post_type = $_GET['post_type'];
16 else
17         wp_die( __('Invalid post type') );
18
19 if ( 'post' != $post_type ) {
20         $parent_file = "edit.php?post_type=$post_type";
21         $submenu_file = "post-new.php?post_type=$post_type";
22 } else {
23         $parent_file = 'edit.php';
24         $submenu_file = 'post-new.php';
25 }
26
27 $post_type_object = get_post_type_object($post_type);
28
29 $title = $post_type_object->labels->add_new_item;
30
31 $editing = true;
32
33 if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
34         wp_die( __( 'Cheatin&#8217; uh?' ) );
35
36 wp_enqueue_script('autosave');
37
38 // Show post form.
39 $post = get_default_post_to_edit( $post_type, true );
40 $post_ID = $post->ID;
41 include('edit-form-advanced.php');
42 include('./admin-footer.php');
43 ?>