Forums

Perform action 'delete_attachment' before DB-update (4 posts)

  1. stephanreiter
    Member
    Posted 10 months ago #

    Currently, the action 'delete_attachment' is performed after all data associated with the attachment in question has been removed from the database. It is therefore not possible to query custom attachment metadata in the action handler, which I would require for additional cleanup steps in a plugin.

    Is there any reason why it is not possible to perform 'delete_attachment' before the database is updated? Because, honestly, the current setup doesn't make a lot of sense to me, i.e. 'delete_attachment' handlers receive the post-id of the deleted attachment, which is, however, no longer valid and therefore useless.

    Thanks,
    Stephan

  2. filosofo
    Member
    Posted 9 months ago #

    I created a ticket here.

  3. filosofo
    Member
    Posted 9 months ago #

    And it has now been committed, so it will appear in WordPress 2.8.

  4. stephanreiter
    Member
    Posted 9 months ago #

    Awesome, thank you!

Reply

You must log in to post.

About this Topic