Make WordPress Core


Ignore:
Timestamp:
09/11/2015 05:03:55 AM (9 years ago)
Author:
wonderboymusic
Message:

Create a new file, wp-admin/includes/noop.php, which loads all of the noop functions for load-script|styles.php and is only loaded by those files. DRYs in the process.

See #33813.

File:
1 edited

Legend:

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

    r33734 r34037  
    1212define( 'WPINC', 'wp-includes' );
    1313
    14 /**
    15  * @ignore
    16  */
    17 function __() {}
    18 
    19 /**
    20  * @ignore
    21  */
    22 function _x() {}
    23 
    24 /**
    25  * @ignore
    26  */
    27 function add_filter() {}
    28 
    29 /**
    30  * @ignore
    31  */
    32 function esc_attr() {}
    33 
    34 /**
    35  * @ignore
    36  */
    37 function apply_filters() {}
    38 
    39 /**
    40  * @ignore
    41  */
    42 function get_option() {}
    43 
    44 /**
    45  * @ignore
    46  */
    47 function is_lighttpd_before_150() {}
    48 
    49 /**
    50  * @ignore
    51  */
    52 function add_action() {}
    53 
    54 /**
    55  * @ignore
    56  */
    57 function did_action() {}
    58 
    59 /**
    60  * @ignore
    61  */
    62 function do_action_ref_array() {}
    63 
    64 /**
    65  * @ignore
    66  */
    67 function get_bloginfo() {}
    68 
    69 /**
    70  * @ignore
    71  */
    72 function is_admin() {return true;}
    73 
    74 /**
    75  * @ignore
    76  */
    77 function site_url() {}
    78 
    79 /**
    80  * @ignore
    81  */
    82 function admin_url() {}
    83 
    84 /**
    85  * @ignore
    86  */
    87 function home_url() {}
    88 
    89 /**
    90  * @ignore
    91  */
    92 function includes_url() {}
    93 
    94 /**
    95  * @ignore
    96  */
    97 function wp_guess_url() {}
    98 
    99 if ( ! function_exists( 'json_encode' ) ) :
    100 /**
    101  * @ignore
    102  */
    103 function json_encode() {}
    104 endif;
    105 
    106 function get_file($path) {
    107 
    108     if ( function_exists('realpath') )
    109         $path = realpath($path);
    110 
    111     if ( ! $path || ! @is_file($path) )
    112         return '';
    113 
    114     return @file_get_contents($path);
    115 }
    116 
    11714$load = $_GET['load'];
    11815if ( is_array( $load ) )
     
    12522    exit;
    12623
    127 require(ABSPATH . WPINC . '/script-loader.php');
    128 require(ABSPATH . WPINC . '/version.php');
     24require( ABSPATH . 'wp-admin/includes/noop.php' );
     25require( ABSPATH . WPINC . '/script-loader.php' );
     26require( ABSPATH . WPINC . '/version.php' );
    12927
    13028$compress = ( isset($_GET['c']) && $_GET['c'] );
Note: See TracChangeset for help on using the changeset viewer.