Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Last active July 17, 2018 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronjonesweb/a223df84aec88e8701124955ec29daf0 to your computer and use it in GitHub Desktop.
Save cameronjonesweb/a223df84aec88e8701124955ec29daf0 to your computer and use it in GitHub Desktop.
Updates the Salesforce API endpoint for the Gravity Forms Salesforce Add-On
<?php
/**
* Updates the Salesforce API endpoint for the Gravity Forms Salesforce Add-On
* From the article Fixing The Gravity Forms Salesforce Add-On For WordPress: https://cameronjonesweb.com.au/blog/fixing-the-gravity-forms-salesforce-add-on-for-wordpress/
*
* @link https://help.salesforce.com/articleView?id=Updating-the-Web-to-Case-and-Web-to-Lead-Endpoint-URL&language=en_US&type=1
* @param string $sub The current subdomain (www or test).
* @param bool $test Whether it's in test mode or not.
* @return string The new subdomain
*/
function cameronjonesweb_salesforce_subdomain( $sub, $test ) {
if ( 'www' === $sub ) {
$sub = 'webto';
}
return $sub;
}
add_filter( 'gf_salesforce_request_subdomain', 'cameronjonesweb_salesforce_subdomain', 99, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment