Contact Forms Builder Shortcodes

Below, you’ll find a detailed guide on how to add the Contact Form Builder, Contact Widget Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Contact Form Builder, Contact Widget Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Contact Form Builder, Contact Widget Plugin and the shortcodes it provides:

Plugin Icon
Contact Form Builder, Contact Widget

"Contact Form Builder, Contact Widget is a comprehensive WordPress plugin for generating and managing contact forms. It's user-friendly, customizable, and perfect for receiving visitor inquiries."

★★★★☆ (21) Active Installs: 3000+ Tested with: 6.2.3 PHP Version: false
Included Shortcodes:
  • [wpdevart_forms]
  • [wpdevart_forms_submissions]

Contact Form Builder [wpdevart_forms] Shortcode

The WPDevart Forms shortcode is a powerful tool that triggers form-related functions. It initiates an email submission process when a form is submitted, and displays a front-end form when the shortcode runs on any page.

Shortcode: [wpdevart_forms]

Examples and Usage

Basic example – A basic usage of the shortcode to display a contact form using the form’s ID as the parameter.

[wpdevart_forms id=1 /]

Advanced examples

Using the shortcode to display a contact form by referencing both ID and title. The form will first try to load by ID, but if not found, it will try to load by title.

[wpdevart_forms id=1 title="Contact Us" /]

Using the shortcode to display a contact form with additional parameters for form style and redirect URL after successful form submission.

[wpdevart_forms id=1 title="Contact Us" style="modern" redirect_url="https://example.com/thank-you" /]

Using the shortcode to display a contact form with a parameter to specify a custom email subject for the form submission email.

[wpdevart_forms id=1 email_subject="New Contact Form Submission" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [wpdevart_forms] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'wpdevart_forms', 'wpda_form_forms_shortcode' );

Shortcode PHP function:

function wpda_form_forms_shortcode( $atts )  {
	ob_start();
	
	//	if a form at front-end has been submitted, check if email
	//	sent successfully or not. function is inside wpdevart-email-submits.php
	$email_success = wpda_form_email_submit($atts);
	if($email_success) {
		echo $email_success;
	} else {
		//	call this function as soon a shortcode runs on any page. 
		//	it'll show front-end form. function is inside front-end/html-template.php
		wpdevart_template($atts); 
	}
	$response = ob_get_clean();
	return $response;
}

Code file location:

contact-forms-builder/contact-forms-builder/functions.php

Contact Form Builder [wpdevart_forms_submissions] Shortcode

The WPDevart Forms Submissions shortcode is a powerful tool that retrieves and displays form submissions. This shortcode calls the function ‘wpda_form_submissions_shortcode’. It captures the output of ‘wpdevart_form_submissions_template’, storing it in a buffer before returning it as a response. This allows for dynamic rendering of form submissions on your WordPress site.

Shortcode: [wpdevart_forms_submissions]

Examples and Usage

Basic example – A simple usage of the shortcode to display the form submissions associated with a specific form ID.

[wpdevart_forms_submissions id="1" /]

Advanced examples

Displaying form submissions with specific form ID and limiting the number of submissions shown. In this case, it will display only the first 5 submissions of the form with ID 1.

[wpdevart_forms_submissions id="1" limit="5" /]

Displaying form submissions with specific form ID and ordering them by submission date. The ‘order’ attribute can accept two values – ‘ASC’ for ascending order and ‘DESC’ for descending order. In this case, it will display the submissions of the form with ID 1 in descending order.

[wpdevart_forms_submissions id="1" order="DESC" /]

Combining multiple parameters. This will display the first 5 submissions of the form with ID 1 in descending order.

[wpdevart_forms_submissions id="1" limit="5" order="DESC" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [wpdevart_forms_submissions] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'wpdevart_forms_submissions', 'wpda_form_submissions_shortcode' );

Shortcode PHP function:

function wpda_form_submissions_shortcode( $atts )  {
	ob_start();
	wpdevart_form_submissions_template($atts);
	return $response = ob_get_clean();
}

Code file location:

contact-forms-builder/contact-forms-builder/functions.php

Conclusion

Now that you’ve learned how to embed the Contact Form Builder, Contact Widget Plugin shortcodes, 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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *