Make WordPress Core


Ignore:
Timestamp:
11/11/2011 08:01:56 PM (13 years ago)
Author:
ryan
Message:

Fix message concatentation. Remove no longer used 'posted' message. fixes #16380

File:
1 edited

Legend:

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

    r19119 r19259  
    198198</h2>
    199199
    200 <?php
    201 if ( isset($_REQUEST['posted']) && $_REQUEST['posted'] ) : $_REQUEST['posted'] = (int) $_REQUEST['posted']; ?>
    202 <div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_REQUEST['posted'] ); ?>"><?php _e('View Post'); ?></a> | <a href="<?php echo get_edit_post_link( $_REQUEST['posted'] ); ?>"><?php _e('Edit Post'); ?></a></p></div>
    203 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
    204 endif; ?>
    205 
    206 <?php if ( isset($_REQUEST['locked']) || isset($_REQUEST['skipped']) || isset($_REQUEST['updated']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) ) { ?>
     200<?php if ( isset($_REQUEST['locked']) || isset($_REQUEST['skipped']) || isset($_REQUEST['updated']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) ) {
     201    $messages = array();
     202?>
    207203<div id="message" class="updated"><p>
    208204<?php if ( isset($_REQUEST['updated']) && (int) $_REQUEST['updated'] ) {
    209     printf( _n( '%s post updated.', '%s posts updated.', $_REQUEST['updated'] ), number_format_i18n( $_REQUEST['updated'] ) );
     205    $messages[] = sprintf( _n( '%s post updated.', '%s posts updated.', $_REQUEST['updated'] ), number_format_i18n( $_REQUEST['updated'] ) );
    210206    unset($_REQUEST['updated']);
    211207}
     
    215211
    216212if ( isset($_REQUEST['locked']) && (int) $_REQUEST['locked'] ) {
    217     printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_REQUEST['locked'] ), number_format_i18n( $_REQUEST['locked'] ) );
     213    $messages[] = sprintf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_REQUEST['locked'] ), number_format_i18n( $_REQUEST['locked'] ) );
    218214    unset($_REQUEST['locked']);
    219215}
    220216
    221217if ( isset($_REQUEST['deleted']) && (int) $_REQUEST['deleted'] ) {
    222     printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_REQUEST['deleted'] ), number_format_i18n( $_REQUEST['deleted'] ) );
     218    $messages[] = sprintf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_REQUEST['deleted'] ), number_format_i18n( $_REQUEST['deleted'] ) );
    223219    unset($_REQUEST['deleted']);
    224220}
    225221
    226222if ( isset($_REQUEST['trashed']) && (int) $_REQUEST['trashed'] ) {
    227     printf( _n( 'Item moved to the Trash.', '%s items moved to the Trash.', $_REQUEST['trashed'] ), number_format_i18n( $_REQUEST['trashed'] ) );
     223    $messages[] = sprintf( _n( 'Item moved to the Trash.', '%s items moved to the Trash.', $_REQUEST['trashed'] ), number_format_i18n( $_REQUEST['trashed'] ) );
    228224    $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
    229     echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
     225    $messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a>';
    230226    unset($_REQUEST['trashed']);
    231227}
    232228
    233229if ( isset($_REQUEST['untrashed']) && (int) $_REQUEST['untrashed'] ) {
    234     printf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) );
     230    $messages[] = sprintf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) );
    235231    unset($_REQUEST['undeleted']);
    236232}
     233
     234if ( $messages )
     235    echo join( ' ', $messages );
     236unset( $messages );
    237237
    238238$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
Note: See TracChangeset for help on using the changeset viewer.