Redirect to edit page with posted blurb as default.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf879c0c55
commit
cc18743397
|
@ -13,10 +13,16 @@ list($post_stati, $avail_post_stati) = wp_edit_posts_query();
|
|||
$wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra )
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
|
||||
<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&post=<?php echo $_GET['posted']; ?>"><?php _e('Edit post'); ?></a></p></div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<?php
|
||||
|
||||
$posts_columns = wp_manage_posts_columns();
|
||||
|
||||
?>
|
||||
|
|
|
@ -22,7 +22,7 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
exit();
|
||||
}
|
||||
|
||||
if ( isset($_GET['posted']) && $_GET['posted'] ) : ?>
|
||||
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
|
||||
<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post »'); ?></a></p></div>
|
||||
<?php
|
||||
endif;
|
||||
|
|
|
@ -12,14 +12,12 @@ if ( isset( $_POST['deletepost'] ) )
|
|||
switch($action) {
|
||||
case 'postajaxpost':
|
||||
case 'post':
|
||||
$parent_file = 'post-new.php';
|
||||
$submenu_file = 'post-new.php';
|
||||
check_admin_referer('add-post');
|
||||
|
||||
$post_ID = 'post' == $action ? write_post() : edit_post();
|
||||
|
||||
// Redirect.
|
||||
if (!empty($_POST['mode'])) {
|
||||
if ( !empty( $_POST['mode'] ) ) {
|
||||
switch($_POST['mode']) {
|
||||
case 'bookmarklet':
|
||||
$location = $_POST['referredby'];
|
||||
|
@ -35,13 +33,13 @@ case 'post':
|
|||
$location = "post-new.php?posted=$post_ID";
|
||||
}
|
||||
|
||||
if ( isset($_POST['save']) )
|
||||
if ( isset( $_POST['save'] ) )
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
|
||||
if ( empty($post_ID) )
|
||||
if ( empty( $post_ID ) )
|
||||
$location = 'post-new.php';
|
||||
|
||||
wp_redirect($location);
|
||||
wp_redirect( $location );
|
||||
exit();
|
||||
break;
|
||||
|
||||
|
@ -139,7 +137,7 @@ case 'editpost':
|
|||
} elseif ($action == 'editattachment') {
|
||||
$location = 'attachments.php';
|
||||
} else {
|
||||
$location = 'post-new.php';
|
||||
$location = 'edit.php?posted=' . $post_ID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue