Easy Pricing Tables Shortcodes

Below, you’ll find a detailed guide on how to add the Easy Pricing Tables 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 Easy Pricing Tables Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Easy Pricing Tables Plugin and the shortcodes it provides:

Plugin Icon
Pricing Tables WordPress Plugin – Easy Pricing Tables

"Pricing Tables WordPress Plugin – Easy Pricing Tables is a user-friendly tool to create and manage stunning price comparison tables on your WordPress site. Simplify pricing with ease!"

★★★★✩ (128) Active Installs: 20000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [ept3-block]
  • [easy-pricing-table]

Easy Pricing Tables [ept3-block] Shortcode

The ‘ept3-block’ shortcode from the Easy Pricing Tables plugin serves to display a specific pricing table on your website. The shortcode retrieves the pricing table using the ID provided in the shortcode attributes. The ‘get_post’ function fetches the table content, which is then returned and displayed on the page.

Shortcode: [ept3-block]

Parameters

Here is a list of all possible ept3-block shortcode parameters and attributes:

  • id – Specifies the unique identifier of the pricing table

Examples and Usage

Basic example – The shortcode allows you to display the Easy Pricing Table by its unique ID. To use it, you simply need to replace ‘1’ with the ID of your table.

[ept3-block id=1 /]

Advanced examples

Displaying two pricing tables on the same page. In this case, the IDs of the tables are 2 and 3. You just need to include two shortcodes, each with a different ID.

[ept3-block id=2 /]
[ept3-block id=3 /]

Displaying a pricing table with a specific ID and applying additional CSS classes to it. This allows you to customize the appearance of the table. Replace ‘my-custom-class’ with your CSS class.

[ept3-block id=1 class="my-custom-class" /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'ept3-block', 'fca_ept_block_shortcode' );

Shortcode PHP function:

function fca_ept_block_shortcode( $atts ){

	$table_ID = empty( $atts['id'] ) ? 0 : $atts['id'];
	$table = get_post( $table_ID );

	return apply_filters( 'the_content', $table->post_content );

}

Code file location:

easy-pricing-tables/easy-pricing-tables/includes/ept-block.php

Easy Pricing Tables [easy-pricing-table] Shortcode

The Easy Pricing Tables shortcode enables dynamic generation of pricing tables. It extracts the ‘id’ from the shortcode, verifies its existence, and retrieves metadata. If the id exists and the pricing table contains content, the shortcode calls a function to generate the table. If not, it returns a message indicating the table doesn’t exist.

Shortcode: [easy-pricing-table]

Parameters

Here is a list of all possible easy-pricing-table shortcode parameters and attributes:

  • id – Unique identifier for the specific pricing table

Examples and Usage

Basic example – The following shortcode displays the pricing table with the ID of 1 on your page or post.

[easy-pricing-table id="1"]

Advanced examples

Here’s an example of using the shortcode to display multiple pricing tables by referencing their IDs. This can be useful when you want to compare different pricing options side by side.

[easy-pricing-table id="1,2,3"]

Another advanced usage of the shortcode is to display a pricing table and providing a fallback in case the table with the specified ID does not exist. In the following example, if the pricing table with the ID of 1 does not exist, the message “Pricing table does not exist. Please check your shortcode.” will be displayed.

[easy-pricing-table id="1" fallback="Pricing table does not exist. Please check your shortcode."]

PHP Function Code

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

Shortcode line:

add_shortcode('easy-pricing-table', 'dh_ptp_message_shortcode');

Shortcode PHP function:

function dh_ptp_message_shortcode($atts)
{
	// extract id shortcode
    extract(shortcode_atts( array('id' => ''), $atts));  

    // check if id exists
    if ($id != '' ) {
    	global $features_metabox;
		$meta = get_post_meta($id, $features_metabox->get_the_id(), TRUE);

        // check if our pricing table contains any content
		if ($meta != "") {
            // if the table contains content, call the function that generates the table
			return do_shortcode(dh_ptp_generate_pricing_table($id));
		}
    }
	
	return __('Pricing table does not exist. Please check your shortcode.', 'easy-pricing-tables');
}

Code file location:

easy-pricing-tables/easy-pricing-tables/includes/shortcodes.php

Conclusion

Now that you’ve learned how to embed the Easy Pricing Tables 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 *