WordPress.org

Ready to get started?Download WordPress

Forums

Issues with delete_post (2 posts)

  1. Joe Banks
    Member
    Posted 3 years ago #

    I seem to be having issues adding my function to the delete_post action hook. I'm trying to delete an associated file before a post is deleted. Any help would be greatly appreciated.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. Joe Banks
    Member
    Posted 3 years ago #

    Oops, here's the code:

    add_action('delete_post', 'jb_hp_admin_delete_photo');
    
    function jb_hp_admin_delete_photo($postid) {
        $custom = get_post_custom($postid);
        $url = $custom["url"][0];
        jb_hp_delete_photo_file($url);
    }

Topic Closed

This topic has been closed to new replies.

About this Topic