Make WordPress Core


Ignore:
Timestamp:
12/10/2009 09:08:31 AM (17 years ago)
Author:
markjaquith
Message:

Allow for saving Press This entries with blank titles. props noel, christoph179. fixes #10715

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/press-this.php

    r12169 r12361  
    4444        $quick['post_status'] = 'draft'; // set as draft first
    4545        $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
    46         $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : '';
    47         $quick['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';
    48         $quick['post_content'] = '';
     46        $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
     47        $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : '  ';
     48        $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
    4949
    5050        // insert the post with nothing in it, to get an ID
     
    6969        // error handling for $post
    7070        if ( is_wp_error($post_ID)) {
     71                wp_delete_post($post_ID);
    7172                wp_die($id);
    72                 wp_delete_post($post_ID);
    7373        // error handling for media_sideload
    7474        } elseif ( is_wp_error($upload)) {
     75                wp_delete_post($post_ID);
    7576                wp_die($upload);
    76                 wp_delete_post($post_ID);
    7777        } else {
    7878                $quick['ID'] = $post_ID;
Note: See TracChangeset for help on using the changeset viewer.