Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18429, comment 22


Ignore:
Timestamp:
02/01/2012 06:28:50 AM (13 years ago)
Author:
maxcutler
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18429, comment 22

    initial v1  
    1 I know `mw_newPost` uses `get_default_post_to_edit` to get an auto-draft to work on before calling `wp_insert_post`, but I'm wondering if that's something we really want to copy. Auto-drafts get cleaned out after seven days, but that can leave a significant amount of cruft behind if `wp_insert_post` fails.
     1I know `mw_newPost` uses `get_default_post_to_edit` to get an auto-draft to work on before calling `wp_insert_post`, but I'm wondering if that's something we really want to copy. Auto-drafts get cleaned out after seven days, but that can leave a significant amount of cruft behind in the meantime if `wp_insert_post` fails.
    22
    33I think I'd prefer if we validated everything before calling `wp_insert_post`, and then only performed the saving for sticky, taxonomy terms, post format, custom fields, and enclosures after the call, when the post truly exists.