Below, you’ll find a detailed guide on how to add the Libsyn Publisher Hub 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 Libsyn Publisher Hub Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Libsyn Publisher Hub Plugin and the shortcodes it provides:

"Libsyn Publisher Hub is a WordPress plugin designed for podcasting. With Libsyn, managing, scheduling, and publishing your podcast content directly to WordPress becomes easy and efficient."
- [iframe]
Libsyn Publisher Hub [iframe] Shortcode
The ‘iframe’ shortcode from the Libsyn Podcasting plugin is designed to embed a media player into a webpage. It handles various attributes, including source, height, and class, and can adjust the iframe’s height to match a target element. It also includes a download link for the episode, with customizable text. The placement of the player and download link can be set to either the top or bottom. Shortcode: [libsyn_unqprfx_embed_shortcode]
Shortcode: [iframe]
Parameters
Here is a list of all possible iframe shortcode parameters and attributes:
src
– Defines the source URL of the iframe content.class
– Specifies the CSS class for the iframe.same_height_as
– Sets the iframe height to match another element.disable_login
– Disables the login for the myLibsyn widget.get_params_from_url
– Adds parameters from the URL to the iframe source.use_download_link
– Enables a download link for the player content.primary_content_url
– Sets the primary content URL for the download link.download_link_text
– Defines the text for the download link.placement
– Specifies the placement of the player download link.
Examples and Usage
Basic example – The following shortcode example embeds a podcast player into a WordPress post or page using the ‘iframe’ shortcode. The ‘src’ attribute is used to specify the source URL of the podcast episode.
[iframe src="https://your-podcast-url.com/episode-1" /]
Advanced examples
Embedding a podcast player with specific height and width. The ‘height’ and ‘width’ attributes allow you to define the size of the player.
[iframe src="https://your-podcast-url.com/episode-1" height="300" width="500" /]
Using the ‘disable_login’ attribute to disable the login feature of the myLibsyn widget. This is useful when you want to prevent users from logging into the widget.
[iframe src="https://your-podcast-url.com/episode-1" disable_login="true" /]
Embedding a podcast player with a download link. The ‘use_download_link’ attribute enables a download link for the podcast episode. The ‘primary_content_url’ attribute is used to specify the download URL of the episode. The ‘download_link_text’ attribute allows you to customize the text of the download link.
[iframe src="https://your-podcast-url.com/episode-1" use_download_link="true" primary_content_url="https://your-podcast-url.com/download/episode-1" download_link_text="Download this episode" /]
Changing the placement of the player. The ‘placement’ attribute allows you to specify the placement of the player. You can set it to ‘top’ to place the player at the top of the content, or ‘bottom’ to place it at the bottom.
[iframe src="https://your-podcast-url.com/episode-1" placement="top" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [iframe]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'iframe', 'libsyn_unqprfx_embed_shortcode' );
Shortcode PHP function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | function libsyn_unqprfx_embed_shortcode( $atts , $content = null ) { $defaults = libsyn_unqprfx_shortcode_defaults(); foreach ( $defaults as $default => $value ) { // add defaults if ( ! @ array_key_exists ( $default , $atts ) ) { // hide warning with "@" when no params at all $atts [ $default ] = $value ; } } $src_cut = substr ( $atts [ "src" ], 0, 35 ); // special case for google maps if ( strpos ( $src_cut , 'maps.google' ) ){ $atts [ "src" ] .= '&output=embed' ; } //handle myLibsyn widget disable player login if ( ! empty ( get_option( 'libsyn-podcasting-settings_enable_mylibsyn_widget' , false) ) ) { $atts [ 'disable_login' ] = 'true' ; // $atts['src'] = rtrim($atts['src'], '/') . '/disable_login/true'; } // get_params_from_url if ( isset( $atts [ "get_params_from_url" ] ) && ( $atts [ "get_params_from_url" ] == '1' || $atts [ "get_params_from_url" ] == 1 || $atts [ "get_params_from_url" ] == 'true' ) ) { if ( $_GET != NULL ) { if ( strpos ( $atts [ "src" ], '?' ) ) { // if we already have '?' and GET params $encode_string = '&' ; } else { $encode_string = '?' ; } foreach ( $_GET as $key => $value ){ $encode_string .= $key . '=' . $value . '&' ; } } $atts [ "src" ] .= $encode_string ; } $html = '' ; if ( isset( $atts [ "same_height_as" ] ) ) { $same_height_as = $atts [ "same_height_as" ]; } else { $same_height_as = '' ; } if ( $same_height_as != '' ) { $atts [ "same_height_as" ] = '' ; if ( $same_height_as != 'content' ) { // we are setting the height of the iframe like as target element if ( $same_height_as == 'document' || $same_height_as == 'window' ) { // remove quotes for window or document selectors $target_selector = $same_height_as ; } else { $target_selector = '"' . $same_height_as . '"' ; } /* @deprecated 1.3.1 $html .= ' <script> jQuery(function($){ var target_height = $(' . $target_selector . ').height(); $("iframe.' . $atts["class"] . '").height(target_height); }); </script>'; */ $html .= ' <script> var ready = (callback) => { if (document.readyState != "loading" ) callback(); else document.addEventListener( "DOMContentLoaded" , callback); } ready(() => { var libsyn_iframe_height = ' . $target_selector . ' .querySelector( "iframe.' . $atts[" class "] . '" ).parentElement.getBoundingClientRect().height; ' . $target_selector . ' .querySelector( "iframe.' . $atts[" class "] . '" ).style.height = libsyn_iframe_height; }); </script>'; } else { // set the actual height of the iframe (show all content of the iframe without scroll) /* @deprecated 1.3.1 $html .= ' <script> jQuery(function($){ $("iframe.' . $atts["class"] . '").bind("load", function() { var embed_height = $(this).contents().find("body").height(); $(this).height(embed_height); }); }); </script>'; */ $html .= ' <script> var ready = (callback) => { if (document.readyState != "loading" ) callback(); else document.addEventListener( "DOMContentLoaded" , callback); } ready(() => { var libsyn_iframe_element = document.querySelector( "iframe.' . $atts[" class "] . '" ); if ( libsyn_iframe_element.addEventListener ) { libsyn_iframe_element.addEventListener( "load" , function () { //var embed_height = libsyn_iframe_element.querySelector("body").getBoundingClientRect().height; var embed_height_defined = '.$atts[' height '].' ; libsyn_iframe_element.style.height = embed_height_defined; }, false); } }); </script>'; } } $html .= '<iframe style="display:block;" ' ; foreach ( $atts as $attr => $value ) { if ( $attr != 'same_height_as' ) { // remove some attributes if ( $value != '' ) { // adding all attributes $html .= ' ' . $attr . '="' . $value . '"' ; } else { // adding empty attributes $html .= '' ; } } } $html .= '></iframe>' ; //do player download link // @since 1.2.1 if ( $atts [ 'use_download_link' ] && ( $atts [ 'use_download_link' ] == "true" || $atts [ 'use_download_link' ] == 1 || $atts [ 'use_download_link' ] === true || $atts [ 'use_download_link' ] == 'use_download_link' ) ) { if ( ! empty ( $atts [ 'primary_content_url' ]) ) { $download_url = $atts [ 'primary_content_url' ]; } else { $download_url = $atts [ 'src' ]; } if ( ! empty ( $atts [ 'download_link_text' ]) ) { $download_link_text = $atts [ 'download_link_text' ]; } else { $download_link_text = 'Click here to download the Episode!' ; } $player_download_link = '<br /><a class="libsyn-download-link" href ="' . $download_url . '" target="_blank">' . $download_link_text . '</a><br />' ; } else { $player_download_link = '' ; } //handle player placement if ( $atts [ 'placement' ] == "top" ) { $html = $html . $player_download_link . "<br />" ; } else { $html = "<br />" . $html . $player_download_link ; } return $html ; } |
Code file location:
libsyn-podcasting/libsyn-podcasting/admin/functions.php
Conclusion
Now that you’ve learned how to embed the Libsyn Publisher Hub 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.
Leave a Reply