WordPress.org

Plugin Directory

Changeset 660422


Ignore:
Timestamp:
01/29/13 00:26:56 (15 months ago)
Author:
wpmuguru
Message:

use $pagenow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • document-repository/trunk/extras.php

    r659405 r660422  
    5050    function admin_init() { 
    5151 
    52         global $wp_version; 
     52        global $wp_version, $pagenow; 
    5353 
    54         if( !isset( $_GET['post'] ) && !isset( $_GET['post_type'] ) ) 
     54        if( !isset( $_GET['post'] ) && !isset( $_GET['post_type'] ) && $pagenow != 'post-new.php' ) 
    5555            return; 
    5656 
    57         $pagename = basename( $_SERVER['REQUEST_URI'] ); 
    58         if( ( $index = strpos( $pagename, '?' ) ) !== false ) 
    59             $pagename = substr( $pagename, 0, $index ); 
    60              
    61         if( $pagename == 'post-new.php' || $pagename == 'post.php' ) 
     57        if( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) 
    6258            wp_enqueue_script( 'ra-document', plugin_dir_url( __FILE__ ) . 'js/media.js', array( 'jquery' ), RA_DOCUMENT_REPO_VERSION, true ); 
    6359 
Note: See TracChangeset for help on using the changeset viewer.