Jotform Shortcode

Below, you’ll find a detailed guide on how to add the Jotform Embed Form 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 Embed Form Plugin shortcode not to show or not to work correctly.

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

Plugin Icon
Jotform Online Forms – Drag & Drop Form Builder, Securely Embed Contact Forms

"Jotform Online Forms is a powerful WordPress plugin that offers a drag & drop form builder. It allows secure embedding of contact forms directly on your site. Simplify data collection with elegant, customizable forms."

★★★✩✩ (27) Active Installs: 20000+ Tested with: 6.0.6 PHP Version: 5.6
Included Shortcodes:
  • [jotform]

Jotform Embed Form [jotform] Shortcode

The ‘jotform’ shortcode is a tool in the embed-form plugin that allows users to embed a specific form into a page. The related PHP function, ‘apiEmbedHandler’, checks if a form ID is specified in the shortcode’s arguments. If an ID is present, it replaces the tags in the content with the form associated with that ID. Otherwise, it returns an empty string.

Shortcode: [jotform]

Parameters

Here is a list of all possible jotform shortcode parameters and attributes:

  • id – The unique code of the form you want to embed.

Examples and Usage

Basic example – Embed a form using its ID as a parameter.

[jotform id=12345 /]

Advanced examples

Use the shortcode to embed multiple forms by referencing their IDs. The forms will load in the order they are listed.

[jotform id=12345,67890,11223 /]

Use the shortcode with an optional parameter to control the form’s display. If the ‘hide’ parameter is set to true, the form will not be visible.

[jotform id=12345 hide=true /]

Use the shortcode with an optional parameter to control the form’s layout. If the ‘layout’ parameter is set to ‘classic’, the form will display in a classic layout.

[jotform id=12345 layout=classic /]

PHP Function Code

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

Shortcode line:

add_shortcode('jotform', array($this, 'apiEmbedHandler'));

Shortcode PHP function:

function apiEmbedHandler($args) {
    	return isset($args['id'])
    		? $this->replaceTags(array('formID' => $args['id']))
    		: '';
    }

Code file location:

embed-form/embed-form/jotform-wp-embed.php

Conclusion

Now that you’ve learned how to embed the Embed Form 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.

Comments

Leave a Reply

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