Make WordPress Core

Changeset 31121


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.

Location:
trunk/src/wp-admin
Files:
6 edited

Legend:

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

    r31106 r31121  
    9292
    9393// $pagenow is set in vars.php
     94// $wp_importers is sometimes set in wp-admin/includes/import.php
     95//
    9496// The remaining variables are imported as globals elsewhere,
    9597//     declared as globals here
    96 global $pagenow, $hook_suffix, $plugin_page, $typenow, $taxnow;
     98global $pagenow, $wp_importers, $hook_suffix, $plugin_page, $typenow, $taxnow;
    9799
    98100$page_hook = null;
  • trunk/src/wp-admin/edit-form-advanced.php

    r30890 r31121  
    1010if ( !defined('ABSPATH') )
    1111    die('-1');
     12
     13global $post_type, $post_type_object, $post;
    1214
    1315wp_enqueue_script('post');
  • trunk/src/wp-admin/edit-tags.php

    r31090 r31121  
    2020if ( ! current_user_can( $tax->cap->manage_terms ) )
    2121    wp_die( __( 'Cheatin’ uh?' ), 403 );
     22
     23// $post_type is set when the WP_Terms_List_Table instance is created
     24global $post_type;
    2225
    2326$wp_list_table = _get_list_table('WP_Terms_List_Table');
  • trunk/src/wp-admin/edit.php

    r30356 r31121  
    1818    }
    1919}
     20
     21global $post_type, $post_type_object;
    2022
    2123$post_type = $typenow;
  • 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
  • trunk/src/wp-admin/post.php

    r29572 r31121  
    2424    $post_id = $post_ID = 0;
    2525
    26 $post = $post_type = $post_type_object = null;
     26global $post_type, $post_type_object, $post;
    2727
    2828if ( $post_id )
Note: See TracChangeset for help on using the changeset viewer.