Make WordPress Core

Ticket #7425: 7425.diff

File 7425.diff, 11.7 KB (added by mdawaffe, 17 years ago)
  • wp-admin/post-new.php

     
    2626}
    2727
    2828if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
    29 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit post'); ?></a></p></div>
     29<div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
    3030<?php
    3131endif;
    3232?>
  • wp-admin/includes/template.php

     
    457457                break;
    458458        case 'title':
    459459                ?>
    460                 <td><strong><a class="row-title" href="page.php?action=edit&amp;post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a></strong>
     460                <td><strong><a class="row-title" href="<?php echo get_edit_post_link( $page->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a></strong>
    461461                <?php if ('private' == $page->post_status) _e(' &#8212; <strong>Private</strong>'); ?></td>
    462462                <?php
    463463                break;
  • wp-admin/post.php

     
    2222                $location = 'sidebar.php?a=b';
    2323        } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    2424                if ( $_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 )
    25                         $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
     25                        $location = add_query_arg( array(
     26                                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
     27                                'message' => 1
     28                        ), get_edit_post_link( $post_ID, 'url' ) );
    2629                else
    27                         $location = "post.php?action=edit&post=$post_ID&message=4";
     30                        $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
    2831        } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    2932                $location = add_query_arg( 'message', 2, wp_get_referer() );
    3033                $location = explode('#', $location);
     
    4750        } elseif ($action == 'editattachment') {
    4851                $location = 'attachments.php';
    4952        } else {
    50                 $location = "post.php?action=edit&post=$post_ID&message=4";
     53                $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
    5154        }
    5255
    5356        wp_redirect( $location );
  • wp-admin/edit-post-rows.php

     
    3434$class = 'alternate' == $class ? '' : 'alternate';
    3535global $current_user;
    3636$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
     37$edit_link = get_edit_post_link( $post->ID );
    3738$title = get_the_title();
    3839if ( empty($title) )
    3940        $title = __('(no title)');
     
    8081                break;
    8182        case 'title':
    8283                ?>
    83                 <td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="post.php?action=edit&amp;post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
     84                <td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
    8485                <?php if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); } ?></td>
    8586                <?php
    8687                break;
     
    173174
    174175        case 'control_edit':
    175176                ?>
    176                 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
     177                <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    177178                <?php
    178179                break;
    179180
  • wp-admin/edit-attachment-rows.php

     
    5454
    5555        case 'media':
    5656                ?>
    57                 <td><strong><a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
     57                <td><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
    5858                <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
    5959                <?php do_action('manage_media_media_column', $post->ID); ?>
    6060                </td>
     
    9797                                        $title = $parent_title;
    9898                        }
    9999                        ?>
    100                         <td><strong><a href="post.php?action=edit&amp;post=<?php echo $post->post_parent; ?>"><?php echo $title ?></a></strong></td>
     100                        <td><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong></td>
    101101                        <?php
    102102                } else {
    103103                        ?>
  • wp-admin/upload.php

     
    111111
    112112<?php
    113113if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
    114 <div id="message" class="updated fade"><p><strong><?php _e('Your media has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View media'); ?></a> | <a href="media.php?action=edit&amp;attachment_id=<?php echo $_GET['posted']; ?>"><?php _e('Edit media'); ?></a></p></div>
     114<div id="message" class="updated fade"><p><strong><?php _e('Your media has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View media'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit media'); ?></a></p></div>
    115115<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
    116116endif;
    117117
  • wp-admin/edit.php

     
    110110endif;
    111111
    112112if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
    113 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit post'); ?></a></p></div>
     113<div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
    114114<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
    115115endif;
    116116?>
  • wp-admin/press-this.php

     
    9393        ?>
    9494        </head>
    9595        <body class="press-this">
    96                 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div>
     96                <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div>
    9797                <div id="footer">
    9898                <p><?php
    9999                do_action('in_admin_footer', '');
  • wp-admin/page.php

     
    2020                $location = 'sidebar.php?a=b';
    2121        } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    2222                if ( $_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 )
    23                         $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "page.php?action=edit&post=$page_ID&message=1" );
     23                        $location = add_query_arg( array(
     24                                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
     25                                'message' => 1
     26                        ), get_edit_post_link( $page_ID, 'url' ) );
    2427                else
    25                         $location = "page.php?action=edit&post=$page_ID&message=4";
     28                        $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    2629        } elseif ($_POST['addmeta']) {
    2730                $location = add_query_arg( 'message', 2, wp_get_referer() );
    2831                $location = explode('#', $location);
     
    4548        } elseif ($action == 'editattachment') {
    4649                $location = 'attachments.php';
    4750        } else {
    48                 $location = "page.php?action=edit&post=$page_ID&message=4";
     51                $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    4952        }
    5053
    5154        wp_redirect($location);
  • wp-admin/edit-pages.php

     
    105105<?php
    106106endif;
    107107if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
    108 <div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="page.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit page'); ?></a></p></div>
     108<div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div>
    109109<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
    110110endif;
    111111?>