CallRail Phone Call Tracking Shortcode

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

Before starting, here is an overview of the CallRail Phone Call Tracking Plugin and the shortcodes it provides:

Plugin Icon
CallRail Phone Call Tracking

"CallRail Phone Call Tracking is a powerful plugin for WordPress that enables businesses to track, record, and analyze phone calls. It provides critical insights to improve marketing and customer service strategies."

★★★★★ (4) Active Installs: 20000+ Tested with: 6.1.4 PHP Version: false
Included Shortcodes:
  • [callrail_form]

CallRail Phone Call Tracking [callrail_form] Shortcode

The CallRail Form shortcode is an essential tool for embedding a specific form on your WordPress site. It uses the form’s unique ID to display it in a designated area. This shortcode is a part of the CallRail Phone Call Tracking plugin. It allows users to insert a form on their webpage by simply using the form’s ID. The shortcode handler function ensures that only valid form IDs are used and returns an empty string if the form ID is invalid. Shortcode: [callrail_form]

Shortcode: [callrail_form]

Parameters

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

  • form_id – The specific identifier for the CallRail form.

Examples and Usage

Basic example – A simple usage of the shortcode to display the form with the given ID.

[callrail_form form_id=1 /]

Advanced examples

Displaying the form using a different form ID. If the form with the given ID doesn’t exist, it will return an empty string.

[callrail_form form_id=2 /]

If the form_id attribute is not provided, the shortcode will return an empty string as there is no form to display.

[callrail_form /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'callrail_form', 'callrail_form_shortcode_handler' );

Shortcode PHP function:

function callrail_form_shortcode_handler( $attributes ) {
	$form_id = esc_attr($attributes['form_id']);

	if ( ! $form_id ) {
		return '';
	}

	return "<div id=\"cr-form-$form_id\"></div>";
}

Code file location:

callrail-phone-call-tracking/callrail-phone-call-tracking/callrail.php

Conclusion

Now that you’ve learned how to embed the CallRail Phone Call Tracking 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 *