WordPress.org

Make WordPress Core

Changeset 11159


Ignore:
Timestamp:
05/02/2009 09:44:09 PM (10 years ago)
Author:
ryan
Message:

Clean up save mssage. see #8713

Location:
trunk/wp-admin
Files:
4 edited

Legend:

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

    r11152 r11159  
    1717if ( isset($_GET['message']) )
    1818    $_GET['message'] = absint( $_GET['message'] );
    19 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attr( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
     19$messages[1] = sprintf(__('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID));
    2020$messages[2] = __('Custom field updated.');
    2121$messages[3] = __('Custom field deleted.');
  • trunk/wp-admin/edit-page-form.php

    r11149 r11159  
    1919if ( isset($_GET['message']) )
    2020    $_GET['message'] = absint( $_GET['message'] );
    21 $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attr( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
     21$messages[1] = sprintf(__('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID));
    2222$messages[2] = __('Custom field updated.');
    2323$messages[3] = __('Custom field deleted.');
    24 $messages[4] = sprintf(__('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID));
    2524$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
    2625$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
  • trunk/wp-admin/page.php

    r10094 r11159  
    3636    } elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    3737        $location = 'sidebar.php?a=b';
    38     } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    39         if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
    40             $location = add_query_arg( array(
    41                 '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
    42                 'message' => 1
    43             ), get_edit_post_link( $page_ID, 'url' ) );
    44         else {
    45             if ( isset( $_POST['publish'] ) ) {
    46                 if ( 'pending' == get_post_status( $page_ID ) )
    47                     $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
    48                 else
    49                     $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
    50             } else {
    51                 $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    52             }
     38    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
     39        if ( isset( $_POST['publish'] ) ) {
     40            if ( 'pending' == get_post_status( $page_ID ) )
     41                $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
     42            else
     43                $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
     44        } else {
     45            $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
    5346        }
    5447    } elseif ( isset($_POST['addmeta']) ) {
     
    6053        $location = explode('#', $location);
    6154        $location = $location[0] . '#postcustom';
    62     } elseif (!empty($referredby) && $referredby != $referer) {
    63         $location = $_POST['referredby'];
    64         $location = remove_query_arg('_wp_original_http_referer', $location);
    65         if ( false !== strpos($location, 'edit-pages.php') )
    66             $location = add_query_arg('posted', $page_ID, $location);
    67         elseif ( false !== strpos($location, 'wp-admin') )
    68             $location = "page-new.php?posted=$page_ID";
    69     } elseif ( isset($_POST['publish']) ) {
    70         $location = "page-new.php?posted=$page_ID";
    7155    } elseif ($action == 'editattachment') {
    7256        $location = 'attachments.php';
    7357    } else {
    74         $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
     58        $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
    7559    }
    7660
  • trunk/wp-admin/post.php

    r10094 r11159  
    3939        elseif ( isset($_POST['publish']) )
    4040            $location = 'sidebar.php?a=b';
    41     } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    42         if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    43             $location = add_query_arg( array(
    44                 '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
    45                 'message' => 1
    46             ), get_edit_post_link( $post_ID, 'url' ) );
    47         else {
    48             if ( isset( $_POST['publish'] ) ) {
    49                 if ( 'pending' == get_post_status( $post_ID ) )
    50                     $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
    51                 else
    52                     $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
    53             } else {
    54                 $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) );
    55             }
     41    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
     42        if ( isset( $_POST['publish'] ) ) {
     43            if ( 'pending' == get_post_status( $post_ID ) )
     44                $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
     45            else
     46                $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
     47        } else {
     48            $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
    5649        }
    5750    } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
     
    6356        $location = explode('#', $location);
    6457        $location = $location[0] . '#postcustom';
    65     } elseif (!empty($referredby) && $referredby != $referer) {
    66         $location = $_POST['referredby'];
    67         $location = remove_query_arg('_wp_original_http_referer', $location);
    68         if ( false !== strpos($location, 'edit.php') || false !== strpos($location, 'edit-post-drafts.php') )
    69             $location = add_query_arg('posted', $post_ID, $location);
    70         elseif ( false !== strpos($location, 'wp-admin') )
    71             $location = "post-new.php?posted=$post_ID";
    72     } elseif ( isset($_POST['publish']) ) {
    73         $location = "post-new.php?posted=$post_ID";
    7458    } elseif ($action == 'editattachment') {
    7559        $location = 'attachments.php';
Note: See TracChangeset for help on using the changeset viewer.