Changeset 18550
- Timestamp:
- 08/16/2011 12:12:02 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r17900 r18550 156 156 <?php screen_icon(); ?> 157 157 <h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php 158 if ( isset($_REQUEST['s']) && $_REQUEST['s'])158 if ( ! empty( $_REQUEST['s'] ) ) 159 159 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?> 160 160 </h2> … … 162 162 <?php 163 163 $message = ''; 164 if ( isset($_GET['posted']) && (int) $_GET['posted']) {164 if ( ! empty( $_GET['posted'] ) ) { 165 165 $message = __('Media attachment updated.'); 166 166 $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 167 167 } 168 168 169 if ( isset($_GET['attached']) && (int) $_GET['attached'] ) { 170 $attached = (int) $_GET['attached']; 169 if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) { 171 170 $message = sprintf( _n('Reattached %d attachment.', 'Reattached %d attachments.', $attached), $attached ); 172 171 $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']); 173 172 } 174 173 175 if ( isset($_GET['deleted']) && (int) $_GET['deleted']) {176 $message = sprintf( _n( 'Media attachment permanently deleted.', '%d media attachments permanently deleted.', $ _GET['deleted']), number_format_i18n( $_GET['deleted'] ) );174 if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) { 175 $message = sprintf( _n( 'Media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted ), number_format_i18n( $_GET['deleted'] ) ); 177 176 $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']); 178 177 } 179 178 180 if ( isset($_GET['trashed']) && (int) $_GET['trashed']) {181 $message = sprintf( _n( 'Media attachment moved to the trash.', '%d media attachments moved to the trash.', $ _GET['trashed']), number_format_i18n( $_GET['trashed'] ) );179 if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) { 180 $message = sprintf( _n( 'Media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed ), number_format_i18n( $_GET['trashed'] ) ); 182 181 $message .= ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo') . '</a>'; 183 182 $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']); 184 183 } 185 184 186 if ( isset($_GET['untrashed']) && (int) $_GET['untrashed']) {187 $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $ _GET['untrashed']), number_format_i18n( $_GET['untrashed'] ) );185 if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] ) ) { 186 $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed ), number_format_i18n( $_GET['untrashed'] ) ); 188 187 $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']); 189 188 } … … 195 194 $messages[5] = __('Media restored from the trash.'); 196 195 197 if ( isset($_GET['message']) && (int) $_GET['message']) {198 $message = $messages[ $_GET['message']];196 if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { 197 $message = $messages[ $_GET['message'] ]; 199 198 $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 200 199 }
Note: See TracChangeset
for help on using the changeset viewer.