Seriously Simple Podcasting Shortcode

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

Before starting, here is an overview of the Seriously Simple Podcasting Plugin and the shortcodes it provides:

Plugin Icon
Seriously Simple Podcasting

"Seriously Simple Podcasting is a user-friendly WordPress plugin, designed to make podcasting straightforward. With this plugin, you can effortlessly manage and publish your podcast content from your WordPress site."

★★★★☆ (285) Active Installs: 30000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [ss_player]

Seriously Simple Podcasting [ss_player] Shortcode

The Seriously Simple Podcasting plugin shortcode ‘ss_player’ is used to embed a media player for podcast episodes on your WordPress site. This shortcode checks if the current post type is a valid podcast type before rendering. If the post is valid, it retrieves the episode’s media file and the selected player style from the site’s options. It then loads the media player with the episode file.

Shortcode: [ss_player]

Examples and Usage

Basic example – In this example, we are using the ‘ss_player’ shortcode without any parameters. This will simply display the podcast player for the current post, assuming the post is of a valid podcast type.

[ss_player /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'ss_player', array( new Player(), 'shortcode' ) );

Shortcode PHP function:

function shortcode( $params ) {

		/**
		 * If we're in an RSS feed, don't render this shortcode
		 */
		if ( is_feed() ) {
			return '';
		}

		$frontent_controller = ssp_frontend_controller();

		$current_post = get_post();

		// only render if this is a valid podcast type
		if ( ! in_array( $current_post->post_type, ssp_post_types( true ), true ) ) {
			return '';
		}

		$episode_id = $current_post->ID;
		$file       = $frontent_controller->get_enclosure( $episode_id );
		if ( get_option( 'permalink_structure' ) ) {
			$file = $frontent_controller->get_episode_download_link( $episode_id );
		}

		$player_style = (string) get_option( 'ss_podcasting_player_style', 'standard' );

		return $frontent_controller->load_media_player( $file, $episode_id, $player_style, 'shortcode' );
	}

Code file location:

seriously-simple-podcasting/seriously-simple-podcasting/php/classes/controllers/class-shortcodes-controller.php

Conclusion

Now that you’ve learned how to embed the Seriously Simple Podcasting 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 *