Skip to content

Instantly share code, notes, and snippets.

@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:23
Seriously Simple Speakers: Rename the 'Speakers' label to something else. In this example I have renamed the 'Speakers' to 'Guests' in both the plural and singular instances - you can make those labels anything you want by editing this code and adding it to your theme's functions.php file or a functionality plugin.
<?php
add_filter( 'ssp_speakers_plural_label', 'ssp_speakers_plural_label_custom' );
function ssp_speakers_plural_label_custom ( $label ) {
return 'Guests';
}
add_filter( 'ssp_speakers_single_label', 'ssp_speakers_single_label_custom' );
function ssp_speakers_single_label_custom ( $label ) {
return 'Guest';
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:25
Seriously Simple Podcasting: Hide the episode audio player
add_filter( 'ssp_show_audio_player', '__return_false' );
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:26
Seriously Simple Podcasting: Add episodes series to episode meta data
add_filter( 'ssp_episode_meta_details', 'ssp_series_title_in_meta', 10, 3 );
function ssp_series_title_in_meta ( $meta, $episode_id, $context ) {
$series_title = get_the_term_list( $episode_id, 'series', 'Series: ', ', ' );
$meta['series'] = $series_title;
return $meta;
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:26
Seriously Simple Podcasting: Remove 'Download file' link from episode meta data
add_filter( 'ssp_episode_meta_details', 'ssp_remove_download_link', 10, 3 );
function ssp_remove_download_link ( $meta, $episode_id, $context ) {
unset( $meta['link'] );
return $meta;
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:27
Seriously Simple Podcasting: Use raw audio file URL instead of custom rewrite
add_filter( 'ssp_episode_download_link', 'ssp_use_raw_audio_file_url', 10, 3 );
function ssp_use_raw_audio_file_url ( $url, $episode_id, $file ) {
return $file;
}
@TheCraigHewitt
TheCraigHewitt / .htaccess
Created July 27, 2019 17:27
Seriously Simple Podcasting: .htaccess line for FastCGI servers to enable password protection for feeds. This line to be added above the WordPress rules in the .htaccess file.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@TheCraigHewitt
TheCraigHewitt / functions.php
Last active December 6, 2021 12:34
Seriously Simple Podcasting: Add blog categories to podcast episodes (frontend).
add_action( 'pre_get_posts', 'ssp_add_podcast_to_category_archives' );
function ssp_add_podcast_to_category_archives( $query ){
if( is_admin() ) {
return;
}
if( $query->is_tax('category') || $query->is_category()) {
$query->set('post_type', array( 'post', 'podcast' ) );
}
@TheCraigHewitt
TheCraigHewitt / cache-exclusion
Created July 27, 2019 17:29
Seriously Simple Podcasting: String to exclude episode files from W3 Total Cache as well as WP Super Cache
/podcast-download/.+
/podcast-player/.+
@TheCraigHewitt
TheCraigHewitt / function.php
Created July 27, 2019 17:30
Seriously Simple Podcasting: Get audio player for specific episode.
global $ss_podcasting;
$audio_player = $ss_podcasting->episode_meta( $episode_id );
@TheCraigHewitt
TheCraigHewitt / functions.php
Last active December 6, 2021 12:34
Seriously Simple Podcasting: Add blog categories to podcast episodes (admin).
add_action( 'init', 'ssp_add_categories_to_podcast', 15 );
function ssp_add_categories_to_podcast () {
register_taxonomy_for_object_type( 'category', 'podcast' );
}