Title: object fields hook, object data hook
Last modified: February 3, 2021

---

# object fields hook, object data hook

 *  Resolved [katjavolker](https://wordpress.org/support/users/katjavolker/)
 * (@katjavolker)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/object-fields-hook-object-data-hook/)
 * Hi, I really need som more information on how to do what.
    I have added a field
   with a key ‘xxx’. How do I determine the methods for this field? Where do they
   come from?
 * The field is showing up in the list but I have no idea what it does and how. 
   How do I test that before syncing? Can I var_dump the data somehow?
 * Also object data hook field I created shows up in the list of fields even though
   I specifically asked for object_type product.
 * What I need to accomplish is to map the term name/ID of the product.

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

 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/object-fields-hook-object-data-hook/#post-13997555)
 * I don’t provide a lot of support for the developer hooks here, but I’ll try to
   give some basic guidance.
 * It sounds like you’re using the [object_sync_for_salesforce_wordpress_object_fields](https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-mapping-options.md#available-wordpress-fields)
   filter. If not, you need to be more specific, but I’ll start with that assumption.
 * This hook is meant to allow you to add fields that aren’t added in a standard
   WordPress way. So if you were working with the user object, this would mean user
   fields that are not in `wp_users` or `wp_usermeta`. The methods array means that
   there needs to be a WordPress function that can work similarly to the core WP
   methods.
 * From the docs:
 *     ```
       array (
           'key' => 'ID',
           'table' => 'wp_users',
           'methods' => array (
               'create' => 'wp_insert_user',
               'read' => 'get_user_by',
               'update' => 'wp_update_user',
               'delete' => 'wp_delete_user'
           )
       ),
       ```
   
 * In this example, you can see the methods for a standard WordPress user ID field.
   You can create it with `wp_insert_user`, read it with `get_user_by`, update it
   with `wp_update_user`, and delete with `wp_delete_user`.
 * What this means is that your field needs to have equivalent methods for creating,
   reading, updating, and deleting its value.
 * And yes, you certainly can do a `var_dump` or `error_log` of any parameters that
   you want in this filter. It’s always a good idea.
 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/object-fields-hook-object-data-hook/#post-14191244)
 * I’m going to mark this as resolved, as it doesn’t seem like you need further 
   help and it is about the specific functionality of developer hooks.

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

The topic ‘object fields hook, object data hook’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/object-sync-for-salesforce.svg)
 * [Object Sync for Salesforce](https://wordpress.org/plugins/object-sync-for-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/object-sync-for-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/object-sync-for-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-sync-for-salesforce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/object-fields-hook-object-data-hook/#post-14191244)
 * Status: resolved