WordPress.org

Make WordPress Core

Changeset 13256


Ignore:
Timestamp:
02/20/2010 09:09:49 PM (8 years ago)
Author:
nacin
Message:

Use admin_url() for images in wp-admin, to allow for filtering. Props mdawaffe, see #12300

Location:
trunk/wp-admin
Files:
12 edited

Legend:

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

    r13182 r13256  
    9696?>
    9797
    98 <img id="header-logo" src="../wp-includes/images/blank.gif" alt="" width="32" height="32" /> <h1 id="site-heading" <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php esc_attr_e('Visit Site') ?>"><span id="site-title"><?php echo $blog_name ?></span> <em id="site-visit-button"><?php _e('Visit Site') ?></em></a><?php if ( ! get_option('blog_public') ) { ?> <a id="privacy-on-link" href="options-privacy.php" title="<?php esc_attr_e('Your blog is hidden from search engines') ?>"><?php _e('Privacy On') ?></a><?php } ?></h1>
     98<img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="32" height="32" /> <h1 id="site-heading" <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php esc_attr_e('Visit Site') ?>"><span id="site-title"><?php echo $blog_name ?></span> <em id="site-visit-button"><?php _e('Visit Site') ?></em></a><?php if ( ! get_option('blog_public') ) { ?> <a id="privacy-on-link" href="options-privacy.php" title="<?php esc_attr_e('Your blog is hidden from search engines') ?>"><?php _e('Privacy On') ?></a><?php } ?></h1>
    9999
    100100<div id="wphead-info">
  • trunk/wp-admin/edit.php

    r13198 r13256  
    361361
    362362<div class="view-switch">
    363     <a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
    364     <a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
     363    <a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
     364    <a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
    365365</div>
    366366
  • trunk/wp-admin/import/livejournal.php

    r12789 r13256  
    969969                    if ( jQuery( '#<?php echo $id ?>' ).length ) {
    970970                        jQuery( "#<?php echo $id ?> input[type='submit']" ).hide();
    971                         str = '<?php _e( "Continuing&#8230;" ) ?> <img src="images/wpspin_light.gif" alt="" id="processing" align="top" />';
     971                        str = '<?php _e( "Continuing&#8230;" ) ?> <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="processing" align="top" />';
    972972                        jQuery( '#<?php echo $msg ?>' ).html( str );
    973973                        jQuery( '#<?php echo $id ?>' ).submit();
     
    998998                        jQuery( "#<?php echo $id ?> input[type='submit']" ).hide();
    999999                        jQuery.ajaxSetup({'timeout':3600000});
    1000                         str = '<?php _e( "Processing next batch." ) ?> <img src="images/wpspin_light.gif" alt="" id="processing" align="top" />';
     1000                        str = '<?php _e( "Processing next batch." ) ?> <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="processing" align="top" />';
    10011001                        jQuery( '#<?php echo $msg ?>' ).html( str );
    10021002                        jQuery('#ljapi-status').load(ajaxurl, {'action':'lj-importer',
  • trunk/wp-admin/includes/dashboard.php

    r13090 r13256  
    425425            <span id="publishing-action">
    426426                <input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
    427                 <img class="waiting" src="images/wpspin_light.gif" />
     427                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
    428428            </span>
    429429            <br class="clear" />
  • trunk/wp-admin/includes/media.php

    r13244 r13256  
    377377
    378378    if ( $do_image )
    379         $out .= "<a href='{$image_upload_iframe_src}&amp;TB_iframe=true' id='add_image' class='thickbox' title='$image_title' onclick='return false;'><img src='images/media-button-image.gif' alt='$image_title' /></a>";
     379        $out .= "<a href='{$image_upload_iframe_src}&amp;TB_iframe=true' id='add_image' class='thickbox' title='$image_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-image.gif' ) ) . "' alt='$image_title' /></a>";
    380380    if ( $do_video )
    381         $out .= "<a href='{$video_upload_iframe_src}&amp;TB_iframe=true' id='add_video' class='thickbox' title='$video_title' onclick='return false;'><img src='images/media-button-video.gif' alt='$video_title' /></a>";
     381        $out .= "<a href='{$video_upload_iframe_src}&amp;TB_iframe=true' id='add_video' class='thickbox' title='$video_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-video.gif' ) ) . "' alt='$video_title' /></a>";
    382382    if ( $do_audio )
    383         $out .= "<a href='{$audio_upload_iframe_src}&amp;TB_iframe=true' id='add_audio' class='thickbox' title='$audio_title' onclick='return false;'><img src='images/media-button-music.gif' alt='$audio_title' /></a>";
    384     $out .= "<a href='{$media_upload_iframe_src}&amp;TB_iframe=true' id='add_media' class='thickbox' title='$media_title' onclick='return false;'><img src='images/media-button-other.gif' alt='$media_title' /></a>";
     383        $out .= "<a href='{$audio_upload_iframe_src}&amp;TB_iframe=true' id='add_audio' class='thickbox' title='$audio_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-music.gif' ) ) . "' alt='$audio_title' /></a>";
     384    $out .= "<a href='{$media_upload_iframe_src}&amp;TB_iframe=true' id='add_media' class='thickbox' title='$media_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-other.gif' ) ) . "' alt='$media_title' /></a>";
    385385
    386386    printf($context, $out);
     
    12151215    if ( gd_edit_image_support( $post->post_mime_type ) ) {
    12161216        $nonce = wp_create_nonce( "image_editor-$post->ID" );
    1217         $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <img src='images/wpspin_light.gif' class='imgedit-wait-spin' alt='' />";
     1217        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <img src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' class='imgedit-wait-spin' alt='' />";
    12181218    }
    12191219
     
    16321632        if ( ! document.forms[0].src.value )
    16331633            document.getElementById('status_img').innerHTML = '*';
    1634         else document.getElementById('status_img').innerHTML = '<img src="images/no.png" alt="" />';
     1634        else document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" alt="" />';
    16351635    },
    16361636
     
    16411641        t.height = t.preloadImg.height;
    16421642        document.getElementById('go_button').style.color = '#333';
    1643         document.getElementById('status_img').innerHTML = '<img src="images/yes.png" alt="" />';
     1643        document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" alt="" />';
    16441644    },
    16451645
     
    16511651            return false;
    16521652        }
    1653         document.getElementById('status_img').innerHTML = '<img src="images/wpspin_light.gif" alt="" />';
     1653        document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />';
    16541654        t.preloadImg = new Image();
    16551655        t.preloadImg.onload = t.updateImageData;
  • trunk/wp-admin/includes/meta-boxes.php

    r12987 r13256  
    208208
    209209<div id="publishing-action">
    210 <img src="images/wpspin_light.gif" id="ajax-loading" style="visibility:hidden;" alt="" />
     210<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" id="ajax-loading" style="visibility:hidden;" alt="" />
    211211<?php
    212212if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
     
    433433<tbody id="the-comment-list" class="list:comment"></tbody>
    434434</table>
    435 <p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p>
     435<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>
    436436<?php
    437437    $hidden = get_hidden_meta_boxes('post');
  • trunk/wp-admin/includes/plugin.php

    r13233 r13256  
    822822
    823823    if ( empty($icon_url) ) {
    824         $icon_url = 'images/generic.png';
     824        $icon_url = esc_url( admin_url( 'images/generic.png' ) );
    825825    } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) {
    826826        $icon_url = 'https://' . substr($icon_url, 7);
  • trunk/wp-admin/includes/template.php

    r13242 r13256  
    6666        <?php $update_text = ( 'post_tag' == $taxonomy ) ? __( 'Update Tag' ) : __( 'Update Category' ); ?>
    6767        <a accesskey="s" href="#inline-edit" title="<?php echo esc_attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a>
    68         <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" />
     68        <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    6969        <span class="error" style="display:none;"></span>
    7070        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
     
    672672    $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
    673673    if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) )
    674         $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
     674        $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
    675675    $posts_columns['date'] = __('Date');
    676676    // @todo filter per type
     
    698698    /* translators: column name */
    699699    $posts_columns['parent'] = _x('Attached to', 'column name');
    700     $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
     700    $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
    701701    //$posts_columns['comments'] = __('Comments');
    702702    /* translators: column name */
     
    11661166            ?>
    11671167            <a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a>
    1168             <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" />
     1168            <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    11691169        <?php } else {
    11701170            $update_text = __( 'Update' );
     
    22772277    <span id="savebtn" style="display:none;"><?php _e('Update Comment'); ?></span>
    22782278    <span id="replybtn" style="display:none;"><?php _e('Submit Reply'); ?></span></a>
    2279     <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" />
     2279    <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    22802280    <span class="error" style="display:none;"></span>
    22812281    <br class="clear" />
     
    26122612    $getit = __( 'WordPress recommends a better browser' );
    26132613    echo '
    2614         <div id="bh"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></div>
     2614        <div id="bh"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="' . esc_url( admin_url( 'images/browse-happy.gif' ) ) . '" alt="Browse Happy" /></a></div>
    26152615';
    26162616}
  • trunk/wp-admin/includes/widgets.php

    r12733 r13256  
    203203        </div>
    204204        <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
    205         <img src="images/wpspin_light.gif" class="ajax-feedback " title="" alt="" />
     205        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" />
    206206        <input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php esc_attr_e('Save'); ?>" />
    207207        </div>
  • trunk/wp-admin/ms-edit.php

    r13115 r13256  
    413413            </head>
    414414            <body id="error-page">
    415                 <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
     415                <h1 id="logo"><img alt="WordPress" src="<?php echo esc_url( admin_url( 'images/wordpress-logo.png' ) ); ?>" /></h1>
    416416                <form action='ms-edit.php?action=<?php echo esc_attr( $_GET[ 'action2' ] ) ?>' method='post'>
    417417                    <input type='hidden' name='action' value='<?php echo esc_attr( $_GET['action2'] ) ?>' />
  • trunk/wp-admin/press-this.php

    r12789 r13256  
    400400                    jQuery('#extra-fields').show();
    401401                }
    402                 jQuery('#extra-fields').before('<div id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></div>');
     402                jQuery('#extra-fields').before('<div id="waiting"><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></div>');
    403403
    404404                if(photostorage == false) {
     
    476476                            <br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" />
    477477                        <?php } ?>
    478                         <img src="images/wpspin_light.gif" alt="" id="saving" style="display:none;" />
     478                        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
    479479                    </p>
    480480                </div>
     
    548548                <li id="photo_button">
    549549                    Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
    550 <img alt="<?php _e('Insert an Image'); ?>" src="images/media-button-image.gif"/></a>
     550<img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif' ) ); ?>"/></a>
    551551                    <?php } ?>
    552552                </li>
    553553                <li id="video_button">
    554                     <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="images/media-button-video.gif"/></a>
     554                    <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif' ) ); ?>"/></a>
    555555                </li>
    556556                <?php if ( user_can_richedit() ) { ?>
  • trunk/wp-admin/widgets.php

    r12789 r13256  
    364364        <div class="sidebar-name-arrow"><br /></div>
    365365        <h3><?php _e('Inactive Widgets'); ?>
    366         <span><img src="images/wpspin_light.gif" class="ajax-feedback" title="" alt="" /></span></h3></div>
     366        <span><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span></h3></div>
    367367        <div class="widget-holder inactive">
    368368        <p class="description"><?php _e('Drag widgets here to remove them from the sidebar but keep their settings.'); ?></p>
     
    386386    <div class="sidebar-name-arrow"><br /></div>
    387387    <h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
    388     <span><img src="images/wpspin_dark.gif" class="ajax-feedback" title="" alt="" /></span></h3></div>
     388    <span><img src="<?php echo esc_url( admin_url( 'images/wpspin_dark.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span></h3></div>
    389389    <?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?>
    390390    </div>
Note: See TracChangeset for help on using the changeset viewer.