Insert or Embed Articulate Content into WordPress Shortcode

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

Before starting, here is an overview of the Insert or Embed Articulate Content into WordPress Plugin and the shortcodes it provides:

Plugin Icon
Insert or Embed Articulate Content into WordPress

"Insert or Embed Articulate Content into WordPress is a helpful plugin that enables users to seamlessly incorporate Articulate content into their WordPress site for enhanced functionality."

★★★★☆ (105) Active Installs: 3000+ Tested with: 6.2.3 PHP Version: 5.6
Included Shortcodes:
  • [iframe_loader]

Insert or Embed Articulate Content into WordPress [iframe_loader] Shortcode

The ‘iframe_loader’ shortcode from the Insert or Embed Articulate Content into WordPress plugin is designed to handle iframe content. This shortcode extracts the ‘src’, ‘width’, ‘height’ attributes, applies filters to ‘src’ and ‘href’, and then returns an iframe HTML tag. The ‘src’ attribute points to the content source, ‘width’ and ‘height’ define the dimensions.

Shortcode: [iframe_loader]

Parameters

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

  • src – URL of the content to be displayed in the iframe
  • width – desired width of the iframe on the page
  • height – desired height of the iframe on the page
  • href – alternative URL for iframe content, used if ‘src’ is not set

Examples and Usage

Basic example – A simple iframe loader that accepts a source URL, width, and height as parameters.

[iframe_loader src="https://example.com" width="500" height="300" /]

Advanced examples

Using the shortcode to load an iframe with a source URL, and custom width and height. The URL is passed through a filter before being used, allowing for dynamic modification of the URL.

[iframe_loader src="https://dynamic.example.com" width="800" height="600" /]

Using the shortcode to load an iframe with a source URL and a fallback href URL. If the source URL is not available, the href URL will be used.

[iframe_loader src="https://example.com" href="https://fallback.example.com" width="500" height="300" /]

Using the shortcode to load an iframe without specifying a width and height. The iframe will default to the size specified in the handler function.

[iframe_loader src="https://example.com" /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'iframe_loader', 'iframe_handler' );

Shortcode PHP function:

                    function iframe_handler( $attr ) {
	$href = '';
	extract( $attr );
	if ( isset( $src ) ) {
		$src = apply_filters( 'iea_iframe_url_after', $src, $attr );
	}
	if ( isset( $href ) ) {
		$href = apply_filters( 'iea_iframe_url_after', $href, $attr );
	}
	return "<p><iframe src='$src' width='$width' height='$height' frameborder='0' scrolling='no'></iframe><br/>";
}
                    

Code file location:

insert-or-embed-articulate-content-into-wordpress/insert-or-embed-articulate-content-into-wordpress/include/shortcode.php

Conclusion

Now that you’ve learned how to embed the Insert or Embed Articulate Content into WordPress 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 *