• Resolved leaddeveloper

    (@leaddeveloper)


    I have added a custom object to the wordpress.php file. I used the below method

    add_filter( 'object_sync_for_salesforce_add_more_wordpress_types', 'add_more_types', 10, 1 );
    			function add_more_types( $wordpress_object_types ) {
    				$wordpress_object_types[] = 'foo'; // this will add to the existing types.
    				return $wordpress_object_types;
    			}

    But my custom object is from another plugin and this particular plugin does not have a meta table created for the particular table i want to pick data from. I need help in connecting the fields from this table without requiring me to enter table meta info in the public function get_wordpress_table_structure( $object_type ){...} section of the code

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    First of all, you shouldn’t add code to the wordpress.php file unless you want to submit a pull request to modify the plugin. The reason is that it could be overwritten when the plugin is updated. You want to do that kind of work in your own plugin, or in your theme’s functions.php file.

    Second, if you’ve added your custom type, you should use the object_sync_for_salesforce_wordpress_object_fields filter to tell the plugin what the fields for your custom object are. It doesn’t require that there be a meta table. It does require that there are WordPress functions available for it to call to create, read, update, and delete data in the table where the fields are. You can read documentation about that filter here: https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-mapping-options.md

    Thread Starter leaddeveloper

    (@leaddeveloper)

    Hello @jonathanstegall,

    thank you for the response. We would very much appreciate if this something you can do, to have you help us with our particular requirements in this case. We would be more than happy to facilitate the time and effort you would put into this.

    please kindly advise

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

The topic ‘Help connecting custom wordpress object’ is closed to new replies.