Title: Custom fields not saving/displaying
Last modified: December 5, 2017

---

# Custom fields not saving/displaying

 *  Resolved [jtrollia](https://wordpress.org/support/users/malivuk/)
 * (@malivuk)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/)
 * Hello,
 * Thanks for your plugin.
 * I’m following your [doc](https://getawesomesupport.com/documentation/awesome-support/custom-fields/)
   to create and save a new field.
 * So far, the field is showing in frontend with the following code:
 *     ```
       function awesomesupport_custom( ) {
       	$checkbox = array(
       		'title' => 'SMS optin',
       		'field_type' => 'checkbox',
       		'options' => array( 'option1' => 'Reply by SMS' ),
       		'capability' => 'edit_ticket'
       	);
       	if ( function_exists( 'wpas_add_custom_field' ) ) {
       		wpas_add_custom_field( 'sms_optin', $checkbox );
       	}
       add_action( 'wpas_submission_form_inside_after_subject', 'awesomesupport_custom', 1 );
       ```
   
 * However, the field is not saved and is not showing in admin/ticket thread. I 
   tried to `var_dump` the `$post` variable in the ticket detail page but I can’t
   find the field value.
 * What did I miss?
 * Alternatively, can you provide an integration example of `save_callback`?
 * Thanks
    -  This topic was modified 8 years, 6 months ago by [jtrollia](https://wordpress.org/support/users/malivuk/).
    -  This topic was modified 8 years, 6 months ago by [jtrollia](https://wordpress.org/support/users/malivuk/).

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

 *  [jmaubert75](https://wordpress.org/support/users/jmaubert75/)
 * (@jmaubert75)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9752290)
 * Hello,
    Ijust wanted to say that I have exactly the same problem. I just could
   not find any way to save custom field. JM
 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9753148)
 * @jtrollia – the custom fields on the back-end will be in a metabox on the right
   hand side of the ticket. Please look for a metabox with the title “custom fields”.
   Custom fields are automatically saved with the ticket and the values are placed
   in this metabox.
 * [@jmaubert75](https://wordpress.org/support/users/jmaubert75/) – please open 
   a new thread with your issue – its going to be tough to trouble-shoot issues 
   for two individuals in the same thread. Since jtrollia started this thread we’ll
   troubleshoot his issue here.
 * Thanks.
 *  Thread Starter [jtrollia](https://wordpress.org/support/users/malivuk/)
 * (@malivuk)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9754651)
 * Hello,
 * Thanks for you answer.
 * I can see nothing more there. I did dump `WPAS()->custom_fields` in `./includes/
   admin/metaboxes/custom-fields-backend.php` and it returns an array of arrays.
   Top-level elements are :
 *     ```
       object(WPAS_Custom_Fields)#538 (2) {
         ["remove_mb"]=> (...)
         ["options"]=> (...)
         ["status"]=> (...)
         ["ticket-tag"]=> (...)
         ["product"]=>  (...) // properly showing as a dropdown
         ["ticket_channel"]=> (...)
         ["secondary_assignee"]=> (...)
         ["tertiary_assignee"]=> (...)
         ["ttl_replies_by_agent"]=> (...)
         ["ttl_replies_by_customer"]=> (...)
         ["ttl_replies"]=> (...)
         ["ttl_calculated_time_spent_on_ticket"]=> (...)
         ["ttl_adjustments_to_time_spent_on_ticket"]=> (...)
         ["time_adjustments_pos_or_neg"]=> (...)
         ["final_time_spent_on_ticket"]=> (...)
         ["time_notes"]=> (...)
         ["first_addl_interested_party_name"]=> (...)
         ["first_addl_interested_party_email"]=> (...)
         ["second_addl_interested_party_name"]=> (...)
         ["second_addl_interested_party_email"]=> (...)
       ```
   
 * Also screenshot of metaboxes here: [https://ibb.co/iA3xCw](https://ibb.co/iA3xCw)
 * No trace of my custom field 🙁
 * Thanks
 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9754671)
 * Hi:
 * It doesn’t look like your custom field is in the custom fields array. Try creating
   the field using the plugins_loaded action hook instead. See if that helps.
 * Thanks.
 *  Thread Starter [jtrollia](https://wordpress.org/support/users/malivuk/)
 * (@malivuk)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9754701)
 * Hmm using `plugins_loaded` doesn’t displays the field in frontend form anymore,
   sadly.
 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9754726)
 * Hi:
 * If the plugins_loaded action hook isn’t showing the fields then something must
   be getting in the way. Are you trying this with just the awesome support plugin
   and your custom function plugin installed? If not, you can try that and see if
   it helps. But, generally speaking the plugins_loaded action hook is the best 
   place to define the custom fields. Its early enough in the loading process that
   everything else that needs access to the custom fields array will have it.
 * Thanks.

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

The topic ‘Custom fields not saving/displaying’ is closed to new replies.

 * ![](https://ps.w.org/awesome-support/assets/icon-256x256.png?rev=1849681)
 * [Awesome Support - WordPress HelpDesk & Support Plugin](https://wordpress.org/plugins/awesome-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/awesome-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/awesome-support/)
 * [Active Topics](https://wordpress.org/support/plugin/awesome-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/awesome-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/awesome-support/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-not-saving-displaying/#post-9754726)
 * Status: resolved