Plugin Author
shauno
(@shauno)
Hey tricks
Unfortunately this was actually my first released plugin, and I hadn’t got into the habit of breaking EVERYTHING down into the simplest APIs.
That being said, inserting directly into the table is pretty simple. Have a look at the nggcf_save_pics() function for a basic idea. It takes all the pictures when saving a gallery in NGG and loops through them INSERTING or UPDATING wp_nggcf_field_values.
Essentially the fields in wp_nggcf_field_values are:
- pid – The picture’s ID
- fid – The custom field’s id (from wp_nggcf_fields)
- field_value – The value string
- dateadded – Just a timestamp (date(‘Y-m-d H:i:s’, time()))
- ngg_type – The constant numeric 1 for images (2 is for gallery custom fields)
Thread Starter
tricks
(@tricks)
Thanks for your quick reply. Sorry I forgot to reply myself. Issue has been solved.