From 2ec4d8bd55c34da3ceeb7e3ed6afc80e69aeba7c Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 18 Nov 2005 09:28:37 +0000 Subject: [PATCH] Set default tab for inline uploader. Props skeltoac. fixes #1905 git-svn-id: https://develop.svn.wordpress.org/trunk@3146 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/inline-uploading.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index 239a856819..58e450796f 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -121,7 +121,10 @@ if ( '' == $sort ) $images = $wpdb->get_results("SELECT ID, post_date, post_title, guid FROM $wpdb->posts WHERE post_status = 'attachment' AND left(post_mime_type, 5) = 'image' $and_post ORDER BY $sort LIMIT $start, $double", ARRAY_A); -if ( count($images) > $num ) { +if ( count($images) == 0 ) { + header("Location: ".basename(__FILE__)."?post=$post&action=upload"); + die; +} elseif ( count($images) > $num ) { $next = $start + count($images) - $num; } else { $next = false;