XF 2.3 How to access attachments in post pre-save?

comraider

Member
Hi,

I'm creating an add-on where I want to run some checks on pre-save when a new thread is being created. If those checks fail, I throw an error to prevent the save from occurring.

I need to access attachments that may have been added to the post. Since we're in pre-save, they haven't been associated with the post yet (and there's no post id), so I'm not sure how to go about this. I had a thought that I could use the attachment temp hash, but I don't know how to access that either.

Can someone shed some light please?
Thanks!
 
Sorry, I meant how to access them programmatically in PHP in my add-on code. I tried using the Attachment repository but it didn't seem to be working, likely because the new attachments aren't associated with the post yet?
 
Back
Top Bottom