WordPress.org

Make WordPress Core

Changeset 11952


Ignore:
Timestamp:
09/19/09 01:06:17 (5 years ago)
Author:
azaozz
Message:

Add "View trash" link to the notice after moving to the trash

Location:
trunk/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r11930 r11952  
    130130        if ( $trashed > 0 ) { 
    131131            printf( _n( '%s comment moved to the trash', '%s comments moved to the trash', $trashed ), $trashed ); 
    132             echo '<br />'; 
     132            echo ' <a href="' . admin_url('edit-comments.php?comment_status=trash') . '">' . __('View trash') . '</a><br />'; 
    133133        } 
    134134        if ( $untrashed > 0 ) { 
  • trunk/wp-admin/edit-pages.php

    r11930 r11952  
    164164if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) { 
    165165    printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) ); 
     166    echo ' <a href="' . admin_url('edit-pages.php?post_status=trash') . '">' . __('View trash') . '</a> '; 
    166167    unset($_GET['trashed']); 
    167168} 
  • trunk/wp-admin/edit.php

    r11930 r11952  
    168168if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) { 
    169169    printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) ); 
     170    echo ' <a href="' . admin_url('edit.php?post_status=trash') . '">' . __('View trash') . '</a> '; 
    170171    unset($_GET['trashed']); 
    171172} 
  • trunk/wp-admin/upload.php

    r11930 r11952  
    166166 
    167167wp_enqueue_script('media'); 
    168 require_once('admin-header.php'); ?> 
    169  
    170 <?php 
    171 if ( isset($_GET['posted']) && (int) $_GET['posted'] ) { 
    172     $_GET['message'] = '1'; 
    173     $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 
    174 } 
    175  
    176 if ( isset($_GET['attached']) && (int) $_GET['attached'] ) { 
    177     $attached = (int) $_GET['attached']; 
    178     $message = sprintf( _n('Reattached %d attachment', 'Reattached %d attachments', $attached), $attached ); 
    179     $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']); 
    180 } 
    181  
    182 $messages[1] = __('Media attachment updated.'); 
    183 $messages[2] = __('Media deleted.'); 
    184 $messages[3] = __('Error saving media attachment.'); 
    185 $messages[4] = __('Media moved to Trash.'); 
    186 $messages[5] = __('Media removed from Trash.'); 
    187  
    188 if ( isset($_GET['message']) && (int) $_GET['message'] ) { 
    189     $message = $messages[$_GET['message']]; 
    190     $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 
    191 } 
     168require_once('admin-header.php'); 
     169 
     170do_action('restrict_manage_posts'); 
    192171?> 
    193  
    194 <?php do_action('restrict_manage_posts'); ?> 
    195172 
    196173<div class="wrap"> 
     
    201178</h2> 
    202179 
    203 <?php 
    204 if ( isset($message) ) { ?> 
     180<?php  
     181$message = ''; 
     182if ( isset($_GET['posted']) && (int) $_GET['posted'] ) { 
     183    $_GET['message'] = '1'; 
     184    $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 
     185} 
     186 
     187if ( isset($_GET['attached']) && (int) $_GET['attached'] ) { 
     188    $attached = (int) $_GET['attached']; 
     189    $message = sprintf( _n('Reattached %d attachment', 'Reattached %d attachments', $attached), $attached ); 
     190    $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']); 
     191} 
     192 
     193if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) { 
     194    $_GET['message'] = '2'; 
     195    $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']); 
     196} 
     197 
     198if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) { 
     199    $_GET['message'] = '4'; 
     200    $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']); 
     201} 
     202 
     203if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { 
     204    $_GET['message'] = '5'; 
     205    $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']); 
     206} 
     207 
     208$messages[1] = __('Media attachment updated.'); 
     209$messages[2] = __('Media permanently deleted.'); 
     210$messages[3] = __('Error saving media attachment.'); 
     211$messages[4] = __('Media moved to the trash.') . ' <a href="' . admin_url('upload.php?status=trash') . '">' . __('View trash') . '</a> '; 
     212$messages[5] = __('Media restored from the trash.'); 
     213 
     214if ( isset($_GET['message']) && (int) $_GET['message'] ) { 
     215    $message = $messages[$_GET['message']]; 
     216    $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 
     217} 
     218 
     219if ( !empty($message) ) { ?> 
    205220<div id="message" class="updated fade"><p><?php echo $message; ?></p></div> 
    206 <?php 
    207 } 
    208 ?> 
     221<?php } ?> 
    209222 
    210223<ul class="subsubsub"> 
Note: See TracChangeset for help on using the changeset viewer.