Make WordPress Core


Ignore:
Timestamp:
01/10/2015 05:28:46 AM (10 years ago)
Author:
wonderboymusic
Message:

Admin globals:

  • Declare $wp_importers as a global in admin.php
  • Declare $post_type, $post_type_object, and $post as globals where applicable

See #30799.

File:
1 edited

Legend:

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

    r30356 r31121  
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111
    12 if ( !isset($_GET['post_type']) )
     12global $post_type, $post_type_object, $post;
     13
     14if ( ! isset( $_GET['post_type'] ) ) {
    1315    $post_type = 'post';
    14 elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
     16} elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) {
    1517    $post_type = $_GET['post_type'];
    16 else
     18} else {
    1719    wp_die( __('Invalid post type') );
    18 
     20}
    1921$post_type_object = get_post_type_object( $post_type );
    2022
Note: See TracChangeset for help on using the changeset viewer.