diff --git a/src/simply-rets-admin.php b/src/simply-rets-admin.php index 0056cc2..8df348b 100644 --- a/src/simply-rets-admin.php +++ b/src/simply-rets-admin.php @@ -33,6 +33,7 @@ public static function register_admin_settings() { register_setting('sr_admin_settings', 'sr_listing_gallery'); register_setting('sr_admin_settings', 'sr_show_leadcapture'); register_setting('sr_admin_settings', 'sr_leadcapture_recipient'); + register_setting('sr_admin_settings', 'sr_leadcapture_custom_form'); register_setting('sr_admin_settings', 'sr_additional_rooms'); register_setting('sr_admin_settings', 'sr_listhub_analytics'); register_setting('sr_admin_settings', 'sr_listhub_analytics_id'); @@ -130,6 +131,15 @@ public static function sr_admin_page() { update_option('sr_custom_disclaimer', htmlentities(stripslashes($_POST['sr_custom_disclaimer']))); } + // Custom POST handler for updating the custom lead capture form + // so we can properly sanitize the input. + if (isset( $_POST['sr_leadcapture_custom_form'] )) { + update_option( + 'sr_leadcapture_custom_form', + htmlentities(stripslashes($_POST['sr_leadcapture_custom_form'])) + ); + } + // Custom POST handler for updating the custom disclaimer // so we can properly sanitize the input. if (isset( $_POST['sr_custom_no_results_message'] )) { @@ -232,6 +242,18 @@ public static function sr_admin_page() { /> + + +

+ Use custom Custom lead capture form HTML or shortcode + + (leave blank to use default form) + + +

+ + +

Map settings

diff --git a/src/simply-rets-api-helper.php b/src/simply-rets-api-helper.php index 867436b..cdfbc58 100644 --- a/src/simply-rets-api-helper.php +++ b/src/simply-rets-api-helper.php @@ -1858,6 +1858,14 @@ public static function srWidgetListingGenerator( $response, $settings ) { public static function srContactFormMarkup($listing) { + $custom_form = get_option('sr_leadcapture_custom_form', false); + + // Use custom form if configured + if ($custom_form != false) { + return do_shortcode($custom_form); + } + + // Default lead capture form $markup = ''; $markup .= '
'; $markup .= '
';