WordPress.org

Make WordPress Core

Ticket #7011: 7011.d.diff

File 7011.d.diff, 10.7 KB (added by mdawaffe, 10 years ago)

bug fixes, eliminate one-offs

  • wp-login.php

     
    1414        <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
    1515        <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    1616        <?php
    17         wp_admin_css( 'css/login' );
    18         wp_admin_css( 'css/colors-fresh' );
     17        wp_admin_css( 'login', true );
     18        wp_admin_css( 'colors-fresh', true );
    1919        ?>
    2020        <script type="text/javascript">
    2121                function focusit() {
  • wp-includes/js/tinymce/wp-mce-help.php

     
    88<title><?php _e('Rich Editor Help') ?></title>
    99<script type="text/javascript" src="tiny_mce_popup.js"></script>
    1010<?php
    11 wp_admin_css( 'css/global' );
    12 wp_admin_css();
     11wp_admin_css( 'global', true );
     12wp_admin_css( 'wp-admin', true );
    1313?>
    1414<style type="text/css">
    1515        #wphead {
  • wp-includes/general-template.php

     
    11381138        return apply_filters( 'wp_admin_css_uri', $_file, $file );
    11391139}
    11401140
    1141 function wp_admin_css( $file = 'wp-admin' ) {
     1141function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    11421142        global $wp_styles;
    11431143        if ( !is_a($wp_styles, 'WP_Styles') )
    11441144                $wp_styles = new WP_Styles();
     
    11461146        $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
    11471147
    11481148        if ( $wp_styles->query( $handle ) ) {
    1149                 if ( did_action( 'wp_print_styles' ) ) // we already printed the style queue.  Print this one immediately
     1149                if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue.  Print this one immediately
    11501150                        wp_print_styles( $handle );
    11511151                else // Add to style queue
    11521152                        wp_enqueue_style( $handle );
  • wp-includes/script-loader.php

     
    217217        $styles->add_data( 'ie', 'conditional', 'gte IE 6' );
    218218
    219219        $styles->add( 'colors', true ); // Register "meta" stylesheet for admin colors
     220        $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css' ); // for login.php.  Is there a better way?
     221        $styles->add_data( 'colors-fresh', 'rtl', true );
    220222
    221223        $styles->add( 'global', '/wp-admin/css/global.css' );
    222224        $styles->add( 'media', '/wp-admin/css/media.css' );
  • wp-admin/includes/widgets.php

     
    285285        $string = str_replace( '&nbsp;', ' ', $string );
    286286        return trim( wp_specialchars( strip_tags( $string ) ) );
    287287}
    288 
    289 function widget_css() {
    290         wp_admin_css( 'css/widgets' );
    291 }
    292 
    293 add_action( 'admin_head', 'widget_css' );
    294 
    295 ?>
  • wp-admin/includes/media.php

     
    126126<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    127127<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
    128128<?php
    129 wp_admin_css( 'css/global' );
     129wp_admin_css( 'global' );
    130130wp_admin_css();
    131 wp_admin_css( 'css/colors' );
     131wp_admin_css( 'colors' );
     132if ( 0 === strpos( $content_func, 'media' ) )
     133        wp_admin_css( 'media' );
     134
    132135?>
    133136<script type="text/javascript">
    134137//<![CDATA[
     
    137140</script>
    138141<?php
    139142do_action('admin_print_scripts');
     143do_action('admin_print_styles');
    140144do_action('admin_head');
    141145if ( is_string($content_func) )
    142146        do_action( "admin_head_{$content_func}" );
     
    182186add_action( 'admin_print_scripts-page-new.php', 'add_thickbox' );
    183187add_action( 'admin_print_scripts-page.php', 'add_thickbox' );
    184188
    185 function media_admin_css() {
    186         wp_admin_css('css/media');
    187 }
    188 
    189189add_action('media_upload_media', 'media_upload_handler');
    190190
    191191function media_upload_form_handler() {
     
    12051205add_action('media_upload_audio', 'media_upload_audio');
    12061206add_action('media_upload_video', 'media_upload_video');
    12071207add_action('media_upload_file', 'media_upload_file');
    1208 add_action('admin_head_media_upload_type_form', 'media_admin_css');
    12091208
    12101209add_filter('media_upload_gallery', 'media_upload_gallery');
    1211 add_action('admin_head_media_upload_gallery_form', 'media_admin_css');
    12121210
    12131211add_filter('media_upload_library', 'media_upload_library');
    1214 add_action('admin_head_media_upload_library_form', 'media_admin_css');
    12151212
    12161213?>
  • wp-admin/update.php

     
    33require_once('admin.php');
    44
    55if ( !current_user_can('edit_plugins') )
    6                 wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
     6        wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
    77
    88function request_filesystem_credentials($form_post, $type = '', $error = false) {
    99        $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error);
     
    151151<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    152152<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Plugin Reactivation'); ?> &#8212; <?php _e('WordPress'); ?></title>
    153153<?php
    154 wp_admin_css( 'css/global' );
    155 wp_admin_css( 'css/colors' );
     154wp_admin_css( 'global', true );
     155wp_admin_css( 'colors', true );
    156156?>
    157157</head>
    158158<body>
  • wp-admin/theme-editor.php

     
    66
    77wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
    88
    9 add_action( 'admin_head', 'theme_editor_css' );
    10 function theme_editor_css(){
    11         wp_admin_css( 'css/theme-editor' );
    12 }
     9wp_admin_css( 'theme-editor' );
    1310
    1411$themes = get_themes();
    1512
  • wp-admin/index.php

     
    2626}
    2727add_action( 'admin_head', 'index_js' );
    2828
    29 function index_css() {
    30         wp_admin_css( 'css/dashboard' );
    31 }
    32 add_action( 'admin_head', 'index_css' );
    33 
    3429wp_enqueue_script( 'jquery' );
     30wp_admin_css( 'dashboard' );
    3531
    3632$title = __('Dashboard');
    3733$parent_file = 'index.php';
  • wp-admin/media.php

     
    6060        add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
    6161
    6262        wp_enqueue_script( 'wp-ajax-response' );
    63         add_action('admin_head', 'media_admin_css');
     63        wp_admin_css( 'media' );
    6464
     65
    6566        require( 'admin-header.php' );
    6667
    6768        $message = '';
  • wp-admin/upgrade.php

     
    1616<head>
    1717        <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    1818        <title><?php _e('WordPress &rsaquo; Upgrade'); ?></title>
    19         <?php wp_admin_css( 'css/install' ); ?>
     19        <?php wp_admin_css( 'install', true ); ?>
    2020</head>
    2121<body>
    2222<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
  • wp-admin/press-this.php

     
    195195<?php
    196196        wp_enqueue_script('jquery-ui-tabs');
    197197        add_thickbox();
     198        wp_admin_css('press-this');
     199        wp_admin_css( 'colors' );
    198200        wp_enqueue_script('post');
     201
    199202        do_action('admin_print_scripts');
     203        do_action('admin_print_styles');
    200204        do_action('admin_head');
    201         wp_admin_css('css/press-this');
    202         wp_admin_css( 'css/colors' );
    203205?>
    204206        <script type="text/javascript">
    205207
  • wp-admin/install.php

     
    1616<head>
    1717        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    1818        <title><?php _e('WordPress &rsaquo; Installation'); ?></title>
    19         <?php wp_admin_css( 'css/install' ); ?>
     19        <?php wp_admin_css( 'install', true ); ?>
    2020</head>
    2121<body>
    2222<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
  • wp-admin/widgets.php

     
    77        wp_die( __( 'Cheatin&#8217; uh?' ));
    88
    99wp_enqueue_script( array( 'wp-lists', 'admin-widgets' ) );
     10wp_admin_css( 'widgets' );
    1011
    1112do_action( 'sidebar_admin_setup' );
    1213
  • wp-admin/sidebar.php

     
    1414<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
    1515<title><?php _e('WordPress &#8250; Posted'); ?></title>
    1616<?php
    17 wp_admin_css( 'css/global' );
    18 wp_admin_css();
     17wp_admin_css( 'global', true );
     18wp_admin_css( 'wp-admin', true );
     19wp_admin_css( 'colors', true );
    1920?>
    2021</head>
    2122<body>
     
    3233<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
    3334<title><?php _e('WordPress &#8250; Sidebar'); ?></title>
    3435<?php
    35 wp_admin_css( 'css/global' );
    36 wp_admin_css();
     36wp_admin_css( 'global', true );
     37wp_admin_css( 'wp-admin', true );
     38wp_admin_css( 'colors', true );
    3739?>
    3840<style type="text/css" media="screen">
    3941form {
  • wp-admin/plugin-editor.php

     
    66
    77wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
    88
    9 add_action( 'admin_head', 'theme_editor_css' );
    10 function theme_editor_css(){
    11         wp_admin_css( 'css/theme-editor' );
    12 }
     9wp_admin_css( 'theme-editor' );
    1310
    1411$plugins = get_plugins();
    1512$plugin_files = array_keys($plugins);