Title: programmatically alter field values
Last modified: August 21, 2016

---

# programmatically alter field values

 *  Resolved [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/programmatically-alter-field-values/)
 * I’d like to be able to set a field value via PHP.
 * For example, I have a form where the user uploads a text file. Upon submitting
   the form, I do some processing on the text file, converting it into WP objects
   and such, and then I delete the uploaded file and I want to remove the path info
   from the upload field.
 * You have getOption to get the stored data, but no publicly exposed setOption.
 * [https://wordpress.org/plugins/admin-page-framework/](https://wordpress.org/plugins/admin-page-framework/)

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

 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/programmatically-alter-field-values/#post-5089232)
 * Use the `value` argument in the field definition array.
 *     ```
       array(
       	'field_id'		=>	'my_text_field',
       	'title'			=>	__( 'My Text Input', 'admin-page-framework-demo' ),
       	'type'			=>	'text',
       	'value'			=>	'',		// <-- always an empty string will be assigned to the field as the value
       ),
       ```
   
 * Example: [https://gist.github.com/michaeluno/fb4088b922b71710c7fb](https://gist.github.com/michaeluno/fb4088b922b71710c7fb)
 * Another option is to use the `options_{instantiated class name}` hook but this
   is available in the development version (3.1.0x). You can download it here [https://github.com/michaeluno/admin-page-framework/archive/3.1.0b.zip](https://github.com/michaeluno/admin-page-framework/archive/3.1.0b.zip)
 * Example: [https://gist.github.com/michaeluno/fcfac27825aa8a35b90f](https://gist.github.com/michaeluno/fcfac27825aa8a35b90f)
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/programmatically-alter-field-values/#post-5089502)
 * Closing due to inactivity.

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

The topic ‘programmatically alter field values’ is closed to new replies.

 * ![](https://ps.w.org/admin-page-framework/assets/icon-256x256.png?rev=998199)
 * [Admin Page Framework](https://wordpress.org/plugins/admin-page-framework/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/admin-page-framework/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/admin-page-framework/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-page-framework/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-page-framework/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-page-framework/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/programmatically-alter-field-values/#post-5089502)
 * Status: resolved