Support » Fixing WordPress » Issues with delete_post

  • Joe Banks

    (@joebanks10)


    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]

Viewing 1 replies (of 1 total)
  • 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);
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Issues with delete_post’ is closed to new replies.