Use wp_redirect().

git-svn-id: https://develop.svn.wordpress.org/trunk@3928 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-06-27 05:38:56 +00:00
parent 7028e093b6
commit 23e2a0a25f
19 changed files with 53 additions and 54 deletions

View File

@@ -41,7 +41,7 @@ if ( !current_user_can('edit_post', (int) $attachment) )
wp_delete_attachment($attachment);
header("Location: " . basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start");
wp_redirect(basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start");
die;
case 'save':
@@ -102,7 +102,7 @@ if ( preg_match('!^image/!', $attachment['post_mime_type']) ) {
add_post_meta($id, '_wp_attachment_metadata', array());
}
header("Location: " . basename(__FILE__) . "?post=$post&all=$all&action=view&start=0");
wp_redirect(basename(__FILE__) . "?post=$post&all=$all&action=view&start=0");
die();
case 'upload':
@@ -141,7 +141,7 @@ if ( '' == $sort )
$attachments = $wpdb->get_results("SELECT ID, post_date, post_title, post_mime_type, guid FROM $wpdb->posts WHERE post_type = 'attachment' $and_type $and_post $and_user ORDER BY $sort LIMIT $start, $double", ARRAY_A);
if ( count($attachments) == 0 ) {
header("Location: " . basename(__FILE__) ."?post=$post&action=upload" );
wp_redirect( basename(__FILE__) ."?post=$post&action=upload" );
die;
} elseif ( count($attachments) > $num ) {
$next = $start + count($attachments) - $num;