Given that I upload a file to wp-content/uploads via FTP, what are the records that I should create in the DB in order for the MediaManager to recognize those new uploads?

2 Answers
2

There is media_handle_sideload() function in core meant for processing files not uploaded through media interface.

It’s not exactly what you need since it assumes file is outside of uploads and needs to be moved there as part of process, but it should give you and idea on generating and inserting it as valid attachment.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *