Title: [Plugin: NextGEN Custom Fields] Set field value by a function
Last modified: August 20, 2016

---

# [Plugin: NextGEN Custom Fields] Set field value by a function

 *  Resolved [tricks](https://wordpress.org/support/users/tricks/)
 * (@tricks)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-set-field-value-by-a-function/)
 * Hi,
    Is it possible to set a field value directly via a php-function instead 
   of via the WP Dashboard?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-set-field-value-by-a-function/#post-2264999)
 * 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](https://wordpress.org/support/users/tricks/)
 * (@tricks)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-set-field-value-by-a-function/#post-2265206)
 * Thanks for your quick reply. Sorry I forgot to reply myself. Issue has been solved.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: NextGEN Custom Fields] Set field value by a function’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/nextgen-gallery-custom-fields.svg)
 * [NextGEN Custom Fields](https://wordpress.org/plugins/nextgen-gallery-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery-custom-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [tricks](https://wordpress.org/support/users/tricks/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-set-field-value-by-a-function/#post-2265206)
 * Status: resolved