X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..refs/tags/wordpress-3.7:/wp-admin/post-new.php diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index c6b709b8..79896c3b 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -1,128 +1,66 @@ -
-

edit_posts capability to your user, in order to be authorized to post.
-You can also e-mail the admin to ask for a promotion.
-When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?> -

-
- -

- +if ( !isset($_GET['post_type']) ) + $post_type = 'post'; +elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) + $post_type = $_GET['post_type']; +else + wp_die( __('Invalid post type') ); +$post_type_object = get_post_type_object( $post_type ); -show_in_menu && $post_type_object->show_in_menu !== true ) { + $parent_file = $post_type_object->show_in_menu; + if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) + $submenu_file = $parent_file; + } else { + $parent_file = "edit.php?post_type=$post_type"; + } +} -$nag_posts_limit = (int) apply_filters('nag_posts_limit', 3); +$title = $post_type_object->labels->add_new_item; -$nag_posts = array( - array( - 'my_drafts', - __('Your Drafts:'), - 'edit.php?post_status=draft&author=' . $user_ID, - count($my_drafts)), - array( - 'pending', - __('Pending Review:'), - 'edit.php?post_status=pending', - count($pending)), - array( - 'others_drafts', - __('Others’ Drafts:'), - 'edit.php?post_status=draft&author=-' . $user_ID, - count($others_drafts)) - ); +$editing = true; -if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) { - echo '
'; +if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) + wp_die( __( 'Cheatin’ uh?' ) ); - foreach ( $nag_posts as $nag ) { - if ( ${$nag[0]} ) { - echo '

' . wp_specialchars($nag[1]) . ' '; - $i = 0; - foreach ( ${$nag[0]} as $post ) { - $i++; - if ( $i > $nag_posts_limit ) - break; - echo ''; - ( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title(); - echo ''; - if ( $i < min($nag[3], $nag_posts_limit) ) - echo ', '; - } - if ( $nag[3] > $nag_posts_limit ) - printf(__(', and %d more'), $nag[2], $nag[3] - $nag_posts_limit); - echo '.

'; - } - } - echo "
\n"; -} -?> +// Schedule auto-draft cleanup +if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) + wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); +wp_enqueue_script( 'autosave' ); - +if ( is_multisite() ) { + add_action( 'admin_footer', '_admin_notice_post_locked' ); +} else { + $check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) ); - -
-

-

-

+ if ( count( $check_users ) > 1 ) + add_action( 'admin_footer', '_admin_notice_post_locked' ); - - - - - -
-
-
- - - - - - -

-
- - +// Show post form. +$post = get_default_post_to_edit( $post_type, true ); +$post_ID = $post->ID; +include( ABSPATH . 'wp-admin/edit-form-advanced.php' ); +include( ABSPATH . 'wp-admin/admin-footer.php' );