WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] delete_post – order changed in newer WP?

[Resolved] delete_post – order changed in newer WP?

  • I have a plugin which does this kind of operation below and it seems like the meta is deleted before the add_action is called

    Has anyone else noticed this? Used to be fine before

    add_action(‘delete_post’, ‘onDeletePost’);
    function onDeletePost($postid) {
    $custom = get_post_custom($postid);
    //do something with $custom;
    return $postid;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Found the answer, new actions in WP 3.2 –

    “Rename duplicate ‘delete_post’ and ‘deleted_post’ actions to ‘before_delete_post’ and ‘after_delete_post'”

    delete_post presumably defaults to after_delete_post. Would be better if the default was before_delete_post

    Thanks for a solution! Very helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] delete_post – order changed in newer WP?’ is closed to new replies.