Hooks - For Developers

Any time you add a custom PHP function to your site, either insert it in the WPCode plugin (recommended), a child theme’s functions.php, or your own custom plugin. If you’re not familiar with using WordPress filters, you can find more details in the WordPress docs.

Hooks - For Developers

Any time you add a custom PHP function to your site, either insert it in the <a href="https://formidableforms.com/go/wpcode/">WPCode</a> plugin (recommended), a child theme's functions.php, or your own custom plugin. If you're not familiar with using WordPress filters, you can find more details in the <a href="https://developer.wordpress.org/reference/functions/add_filter/">WordPress docs</a>.

Google Maps

6 Articles

Ratings

1 Article

Regions

1 Article

Add field to listing contact form

This article provides instructions for how to add a phone number to the Listing Contact form. The code could be...

wpbd_column_count

Show the listings in a set a custom number of columns on the directory pages. Use 1, 2, 3, 4, or 6 columns.

wpbdp_listings_class

Add extra classes to the main listings page.

wpbdp_abc_filter_letters

Change the letter and characters included in the ABC filtering.

wpbdp_after_render_receipt

Add content to the checkout receipt.

wpbdp_before_category_page

Add content at the top of the category pages.

wpbdp_contact_form_output

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

wpbdp_heading_type

Change the default h1 for the heading on a single listing page to something else.

wpbdp_is_numeric_sort

When sorting listings on the front-end, there are two ways to treat a value as a number. First, you can edit the field settings and set it to validate as a decimal. If you need a more flexible way of setting if the field is a number, you can use this hook.

wpbdp-listing-buttons

Make adjustments to the buttons before they are displayed on the page. This includes the edit and delete buttons on the single listing page, and on the page that shows all listings.

wpbdp_listing_search_parse_request

This hook can be used to change an "and" search to an "and/or" search. The hook actually works for both the quick search and advanced search settings, but in general, it was created especially for advanced searches that contain more search parameters.

wpbdp_thumbnail_html

This hook can be used to filter the listing main thumbnail HTML.

wpbdp_before_excerpts

This hook can be used to add new content before listing excerpt.

wpbdp_settings_subtab_[subtab name]

This hook can be used add custom content in the general settings subtab.

wpbdp_get_page_ids

This hook can be used to get the list of pages the plugin is used on.

wpbdp_allow_template_override

This hook can be used to prevent Business Directory from controlling the page template.

wpbdp_use_template_[template id]

This hook can be used to override template file.

wpbdp_skip_page_1

This hook can be used to show the first page when it's skipped (it's automatically skipped if there's only 1 category and 1 plan to choose from). If someone wants the plan to show first, use this hook

wpbdp_paid_listing_status

This hook can be used to always mark paid listings as published, regardless of default status.

wpbdp_field_schema_org

This hook can be used to include or edit Schema.org items for each form field; here's an example to illustrate field filtering.