Make WordPress Core


Ignore:
Timestamp:
05/18/2009 08:29:26 PM (17 years ago)
Author:
azaozz
Message:

Clean the cache-manifests, make $manifest_version and $tinymce_version global vars accessible from the manifest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/manifest.php

    r11204 r11388  
    33if ( !defined('ABSPATH') )
    44    exit;
    5 /**
    6  * @ignore
    7  */
    8 function __() {}
    9 
    10 /**
    11  * @ignore
    12  */
    13 function _c() {}
    14 
    15 /**
    16  * @ignore
    17  */
    18 function _x() {}
    19 
    20 
    21 /**
    22  * @ignore
    23  */
    24 function add_filter() {}
    25 
    26 /**
    27  * @ignore
    28  */
    29 function esc_attr() {}
    30 
    31 /**
    32  * @ignore
    33  */
    34 function attribute_escape() {}
    35 
    36 /**
    37  * @ignore
    38  */
    39 function apply_filters() {}
    40 
    41 /**
    42  * @ignore
    43  */
    44 function get_option() {}
    45 
    46 /**
    47  * @ignore
    48  */
    49 function is_lighttpd_before_150() {}
    50 
    51 /**
    52  * @ignore
    53  */
    54 function add_action() {}
    55 
    56 /**
    57  * @ignore
    58  */
    59 function do_action_ref_array() {}
    60 
    61 /**
    62  * @ignore
    63  */
    64 function get_bloginfo() {}
    65 
    66 /**
    67  * @ignore
    68  */
    69 function is_admin() {return true;}
    70 
    71 /**
    72  * @ignore
    73  */
    74 function site_url() {}
    75 
    76 /**
    77  * @ignore
    78  */
    79 function admin_url() {}
    80 
    81 /**
    82  * @ignore
    83  */
    84 function wp_guess_url() {}
    85 
    86 require(ABSPATH . '/wp-includes/script-loader.php');
    87 require(ABSPATH . '/wp-includes/version.php');
     5
     6require(ABSPATH . 'wp-includes/version.php');
     7
     8$man_version = md5( $tinymce_version . $manifest_version );
     9$mce_ver = "ver=$tinymce_version";
    8810
    8911/**
     
    9214 * Array format: file, version (optional), bool (whether to use src and set ignoreQuery)
    9315 */
    94 
    95 $wp_scripts = new WP_Scripts();
    96 wp_default_scripts($wp_scripts);
    97 
    98 $wp_styles = new WP_Styles();
    99 wp_default_styles($wp_styles);
    100 
    101 function &get_manifest(&$man_ver) {
    102     global $wp_scripts, $wp_styles, $wp_version;
    103 
    104     $files = array();
    105     foreach ( $wp_scripts->registered as $script ) {
    106         if ( empty($script->src) ) continue;
    107         $ver = empty($script->ver) ? $wp_version : $script->ver;
    108         if ( 'editor' == $script->handle ) $mce_ver = $script->ver;
    109         $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
    110         $files[] = array($src, $ver);
    111         $man_ver .= $ver;
    112     }
    113 
    114     foreach ( $wp_styles->registered as $style ) {
    115         if ( empty($style->src) ) continue;
    116 
    117         $ver = empty($style->ver) ? $wp_version : $style->ver;
    118         $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
    119         if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
    120         $files[] = array($src, $ver);
    121          $man_ver .= $ver;
    122 
    123         if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) {
    124             if ( is_bool( $style->extra['rtl'] ) )
    125                 $rtl_href = str_replace( '.css', '-rtl.css', $src );
    126             else
    127                 $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );
    128 
    129             $files[] = array($rtl_href, $ver);
    130              $man_ver .= $ver;
    131         }
    132     }
    133 
    134     $images = array(
     16function &get_manifest() {
     17    global $mce_ver;
     18
     19    $files = array(
    13520        array('images/align-center.png'),
    13621        array('images/align-left.png'),
     
    20489    );
    20590
    206     $files = array_merge($files, $images);
    207 
    20891    if ( @is_file('../wp-includes/js/tinymce/tiny_mce.js') ) :
    20992    $mce = array(
    210         array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver, true),
     93        array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=1&' . $mce_ver, true),
     94        array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=0&' . $mce_ver, true),
     95
    21196        array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver, true),
    21297        array('../wp-includes/js/tinymce/langs/wp-langs-en.js', $mce_ver, true),
Note: See TracChangeset for help on using the changeset viewer.