Below, you’ll find a detailed guide on how to add the Lead Form Builder Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Lead Form Builder Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Lead Form Builder Plugin and the shortcodes it provides:
"Responsive Contact Form Builder & Lead Generation Plugin is a versatile tool for creating customizable contact forms. It optimizes lead generation, streamlines communication, and enhances user engagement."
- [lead-form]
Lead Form Builder [lead-form] Shortcode
The Lead Form Builder shortcode is a vital tool for form generation. It allows you to create and display a lead form with a specified ID and title. The shortcode uses the function ‘lfb_lead_form_shortcode’, which outputs the form based on the given attributes. The form ID and title can be customized, providing flexibility in form creation and placement.
Shortcode: [lead-form]
Parameters
Here is a list of all possible lead-form shortcode parameters and attributes:
form-id
– Identifies the specific form to displaytitle
– Sets the title of the lead form
Examples and Usage
Basic example – A shortcode to display a lead form with a specified ID.
[lead-form form-id=1 /]
Advanced examples
Displaying a lead form by referencing both form-id and title. The form will first try to load by ID, but if not found, it will try to load by title.
[lead-form form-id=2 title='Contact Form' /]
Displaying a lead form by only referencing the title. In this case, the form will try to load by title.
[lead-form title='Registration Form' /]
PHP Function Code
In case you have difficulties debugging what causing issues with [lead-form]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('lead-form', 'lfb_lead_form_shortcode');
Shortcode PHP function:
function lfb_lead_form_shortcode($atts) {
$output = '';
$pull_quote_atts = shortcode_atts(array(
'form-id' => 1,
'title' => esc_html__('Lead Form','lead-form-builder'),
), $atts);
$this_form_id = wp_kses_post($pull_quote_atts['form-id']);
$th_front_end_froms = new LFB_Front_end_FORMS();
$output = $th_front_end_froms->lfb_show_front_end_forms($this_form_id);
return $output;
}
Code file location:
lead-form-builder/lead-form-builder/inc/lf-shortcode.php
Conclusion
Now that you’ve learned how to embed the Lead Form Builder Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply