publish_post action must be subsequent to draft_save, which calls entry_prepare, which in turn sets global $post
This commit is contained in:
parent
925eeb979a
commit
ea2de810ac
@ -748,12 +748,13 @@
|
|||||||
$id = bdb_idfromtime(BDB_ENTRY, $entry['date']);
|
$id = bdb_idfromtime(BDB_ENTRY, $entry['date']);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action('publish_post', $id, $entry);
|
|
||||||
|
|
||||||
// PHASE 2 : Store
|
// PHASE 2 : Store
|
||||||
|
|
||||||
// secure data as DRAFT
|
// secure data as DRAFT
|
||||||
|
// (entry is also implicitly entry_prepare()'d here)
|
||||||
$ret = draft_save($entry, $id);
|
$ret = draft_save($entry, $id);
|
||||||
|
do_action('publish_post', $id, $entry);
|
||||||
|
|
||||||
if ($ret === false) {
|
if ($ret === false) {
|
||||||
return -1; // FAILURE: ABORT
|
return -1; // FAILURE: ABORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user