Use default_category option if not cat specified.
git-svn-id: https://develop.svn.wordpress.org/trunk@2648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
15dc0c3307
commit
f2d1f8460f
@ -6,7 +6,7 @@
|
||||
* generic function for inserting data into the posts table.
|
||||
*/
|
||||
function wp_insert_post($postarr = array()) {
|
||||
global $wpdb, $post_default_category, $allowedtags, $user_ID;
|
||||
global $wpdb, $allowedtags, $user_ID;
|
||||
|
||||
// export array as variables
|
||||
extract($postarr);
|
||||
@ -21,7 +21,7 @@ function wp_insert_post($postarr = array()) {
|
||||
|
||||
// Make sure we set a valid category
|
||||
if (0 == count($post_category) || !is_array($post_category)) {
|
||||
$post_category = array($post_default_category);
|
||||
$post_category = array(get_option('default_category'));
|
||||
}
|
||||
$post_cat = $post_category[0];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user