WordPress Business Directory Plugin

  • Features
  • Pricing
  • Blog
  • Support
  • Login
  • Get Started

wpbdp_contact_form_output

Last Updated: November 25, 2020

  1. Home
  2. Knowledge Base
  3. Customizations
  4. Hooks - For Developers
  5. wpbdp_contact_form_output
Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Make changes to the contact form on the listings pages, or completely replace it.

Usage

add_filter( 'wpbdp_contact_form_output', 'bd_contact_form', 10, 2 );

Parameters

  • $form (string) – The content for the listing contact form
  • $atts (array)
    • $atts['listing_id'] (int)

Examples

Replace contact form with Formidable

Create a custom contact form with Formidable Forms to use on the listing page. Replace 33 in the example with the ID of your form.

add_filter( 'wpbdp_contact_form_output', 'bd_frm_contact_form', 10, 2 );
function bd_frm_contact_form( $form, $atts ) {
	$listing_id = $atts['listing_id'];
	$send_to = wpbusdirman_get_the_business_email( $listing_id );
	return do_shortcode( '[formidable id=33 listemail="' . esc_attr( $send_to ) . '"]' );
}

To connect the form to the listings, you'll need a few fields in the contact form.

  • Add a hidden field with the default value [get param=listemail]. Use this hidden field for the recipient email address.
  • Get the listing name for use in the email with a hidden field. Use the default value [post_title].

Get more information about default values in Formidable Forms.

Change Log

Added in version 5.8.2

Related Articles

  • wpbdp_admin_listing_owner_mode
  • wpbdp_custom_strings
  • wpbdp_region_find_args
  • wpbdp_field_schema_org
  • wpbdp_paid_listing_status
  • wpbdp_skip_page_1

Topics

  • Usage
  • Parameters
  • Examples
    • Replace contact form with Formidable
  • Change Log

Quick Links

  • Getting Started Guide
  • Knowledge Base
  • Change Log

Build Easy Directory Listings

Our WordPress directory plugin will help you create the online listings website you've been planning. And with our 14-day risk-free trial, there's no reason to wait.
Start earning customers today.

Get Business Directory Now

Resources

  • Blog
  • Contact
  • Video Tutorials
  • Affiliates
  • Best Directory Websites Showcase
  • Demo

Purchase

  • Pricing
  • Business Directory Themes
  • Free Business Directories

Our Brands

  • Formidable Forms
  • AWP Classifieds

Business Directory Plugin for WordPress

Copyright © 2010–2022 Strategy11 LLC
Privacy Policy | Terms of Service | Sitemap

Join 20,000+ using Business Directory Plugin to build website directories fast. Get Started See User Reviews