MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
93 stars 48 forks source link

Added filter to short-circuit API calls to Salesforce. Thanks to GitHub user @verygoodplugins for the submission. #512

Closed verygoodplugins closed 1 year ago

verygoodplugins commented 1 year ago

What does this Pull Request do?

This PR adds a filter to the http_request() function in class Object_Sync_Sf_Salesforce to allow short-circuiting the API call and response.

The goal of the PR is to help create a tighter integration with WP Fusion (https://github.com/verygoodplugins/wp-fusion-lite/ and https://wpfusion.com/).

The logic follows what already exists in WP core, for example with update_metadata(): https://github.com/WordPress/WordPress/blob/master/wp-includes/meta.php#L233

With this filter in place, we will be able to:

We're excited to create a deeper integration between WP Fusion and Object Sync for Salesforce, and this change would allow us to tie the two plugins together much more closely than is currently possible.

Thanks for your consideration :)

jonathanstegall commented 1 year ago

Thanks for this! There's nothing obvious that looks troubling at all, I just want to have a chance to run it before I merge it, and also add the new hook to the developer hook documentation spots where it belongs.