Make WordPress Core


Ignore:
Timestamp:
01/12/2010 12:14:27 AM (14 years ago)
Author:
ryan
Message:

Merge page-new.php into post-new.php. Start abstracting column headers and prefs. see #9674

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post-new.php

    r12597 r12702  
    1010require_once('admin.php');
    1111
    12 if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('_show' => true) ) ) )
     12if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('_show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )
    1313    $post_type = $_GET['post_type'];
    1414else
     
    1818    $parent_file = "edit.php?post_type=$post_type";
    1919    $submenu_file = "post-new.php?post_type=$post_type";
     20    if ( 'page' == $post_type )
     21        $parent_file = 'edit-pages.php';
    2022} else {
    2123    $parent_file = 'edit.php';
     
    3638wp_enqueue_script('word-count');
    3739
    38 if ( ! current_user_can('edit_posts') ) {
     40if ( 'post' == $post_type && !current_user_can('edit_posts') ) {
    3941    require_once ('./admin-header.php'); ?>
    4042<div class="wrap">
     
    5052
    5153// Show post form.
    52 $post = get_default_post_to_edit();
    53 $post->post_type = $post_type;
    54 include('edit-form-advanced.php');
     54if ( current_user_can('edit_' . $post_type_object->capability_type . 's') ) {
     55    $post = get_default_post_to_edit( $post_type );
     56    include('edit-form-advanced.php');
     57}
    5558
    5659include('admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.