Skip to content

Commit

Permalink
Merge pull request #227 from TheCraigHewitt/release/1.18.0
Browse files Browse the repository at this point in the history
Release/1.18.0
  • Loading branch information
jonathanbossenger authored Oct 9, 2017
2 parents a850071 + 75d0bbc commit 81c9ac4
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 88 deletions.
3 changes: 3 additions & 0 deletions assets/css/player.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.podcast_player{
margin: 15px 0;
}
1 change: 1 addition & 0 deletions assets/css/player.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.podcast_player{margin:15px 0}
111 changes: 56 additions & 55 deletions includes/class-ssp-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,48 +784,6 @@ public function custom_fields() {
'section' => 'info',
'meta_description' => __( 'The type of podcast episode - either Audio or Video', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_title'] = array(
'name' => __( 'iTunes Episode Title (Exclude Your Series / Show Number):', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Episode Title. NO Series / Show Number Should Be Included.', 'seriously-simple-podcasting' ),
'type' => 'text',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Title. NO Series / Show Number Should Be Included', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_season_number'] = array(
'name' => __( 'iTunes Season Number:', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Season Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
'type' => 'number',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Season Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_episode_type'] = array(
'name' => __( 'iTunes Episode Type:', 'seriously-simple-podcasting' ),
'description' => '',
'type' => 'select',
'default' => '',
'options' => array(
'' => __( 'Please Select', 'seriously-simple-podcasting' ),
'full' => __( 'Full: For Normal Episodes', 'seriously-simple-podcasting' ),
'trailer' => __( 'Trailer: Promote an Upcoming Show', 'seriously-simple-podcasting' ),
'bonus' => __( 'Bonus: For Extra Content Related To a Show', 'seriously-simple-podcasting' )
),
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Type', 'seriously-simple-podcasting' ),
);

// In v1.14+ the `audio_file` field can actually be either audio or video, but we're keeping the field name here for backwards compatibility
$fields['audio_file'] = array(
Expand Down Expand Up @@ -864,18 +822,61 @@ public function custom_fields() {
'section' => 'info',
'meta_description' => __( 'The size of the podcast episode for display purposes.', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_episode_number'] = array(
'name' => __( 'iTunes Episode Number:', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Episode Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
'type' => 'number',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_episode_number'] = array(
'name' => __( 'iTunes Episode Number:', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Episode Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
'type' => 'number',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_title'] = array(
'name' => __( 'iTunes Episode Title (Exclude Your Series / Show Number):', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Episode Title. NO Series / Show Number Should Be Included.', 'seriously-simple-podcasting' ),
'type' => 'text',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Title. NO Series / Show Number Should Be Included', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_season_number'] = array(
'name' => __( 'iTunes Season Number:', 'seriously-simple-podcasting' ),
'description' => __( 'The iTunes Season Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
'type' => 'number',
'default' => '',
'section' => 'info',
'meta_description' => __( 'The iTunes Season Number. Leave Blank If None.', 'seriously-simple-podcasting' ),
);

/**
* New iTunes Tag Announced At WWDC 2017
*/
$fields['itunes_episode_type'] = array(
'name' => __( 'iTunes Episode Type:', 'seriously-simple-podcasting' ),
'description' => '',
'type' => 'select',
'default' => '',
'options' => array(
'' => __( 'Please Select', 'seriously-simple-podcasting' ),
'full' => __( 'Full: For Normal Episodes', 'seriously-simple-podcasting' ),
'trailer' => __( 'Trailer: Promote an Upcoming Show', 'seriously-simple-podcasting' ),
'bonus' => __( 'Bonus: For Extra Content Related To a Show', 'seriously-simple-podcasting' )
),
'section' => 'info',
'meta_description' => __( 'The iTunes Episode Type', 'seriously-simple-podcasting' ),
);


if ( ssp_is_connected_to_podcastmotor() ) {
$fields['filesize_raw'] = array(
Expand All @@ -901,7 +902,7 @@ public function custom_fields() {
'type' => 'checkbox',
'default' => '',
'section' => 'info',
'meta_description' => __( 'Indicates whether the episode is explicit or not.', 'seriously-simple-podcasting' ),
'meta_description' => __( 'Indicates whether the episode is explicit.', 'seriously-simple-podcasting' ),
);

$fields['block'] = array(
Expand Down
56 changes: 41 additions & 15 deletions includes/class-ssp-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function __construct( $file, $version ) {

// Handle localisation
add_action( 'plugins_loaded', array( $this, 'load_localisation' ) );

add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ) );
}

/**
Expand Down Expand Up @@ -350,10 +352,6 @@ public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
$meta['new_window'] = true;
}

if( $link ) {
$meta['duration'] = $duration;
}

if( $date_recorded ) {
$meta['date_recorded'] = $date_recorded;
}
Expand All @@ -362,34 +360,33 @@ public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
$meta = apply_filters( 'ssp_episode_meta_details', $meta, $episode_id, $context );

$meta_display = '';
$podcast_display = '';
$subscribe_display = '';

$meta_sep = apply_filters( 'ssp_episode_meta_separator', ' | ' );
foreach ( $meta as $key => $data ) {

if( ! $data ) {
continue;
}

if( $meta_display ) {
$meta_display .= $meta_sep;
if( $podcast_display ) {
$podcast_display .= $meta_sep;
}

switch( $key ) {

case 'link':
$meta_display .= '<a href="' . esc_url( $data ) . '" title="' . get_the_title() . ' " class="podcast-meta-download" download>' . __( 'Download file' , 'seriously-simple-podcasting' ) . '</a>';
$podcast_display .= '<a href="' . esc_url( $data ) . '" title="' . get_the_title() . ' " class="podcast-meta-download">' . __( 'Download file' , 'seriously-simple-podcasting' ) . '</a>';
break;

case 'new_window':
$play_link = add_query_arg( 'ref', 'new_window', $link );
$meta_display .= '<a href="' . esc_url( $play_link ) . '" target="_blank" title="' . get_the_title() . ' " class="podcast-meta-new-window">' . __( 'Play in new window' , 'seriously-simple-podcasting' ) . '</a>';
break;

case 'duration':
$meta_display .= '<span class="podcast-meta-duration">' . __( 'Duration' , 'seriously-simple-podcasting' ) . ': ' . $data . '</span>';
$podcast_display .= '<a href="' . esc_url( $play_link ) . '" target="_blank" title="' . get_the_title() . ' " class="podcast-meta-new-window">' . __( 'Play in new window' , 'seriously-simple-podcasting' ) . '</a>';
break;

case 'date_recorded':
$meta_display .= '<span class="podcast-meta-date">' . __( 'Recorded on' , 'seriously-simple-podcasting' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $data ) ) . '</span>';
$podcast_display .= $meta_sep.'<span class="podcast-meta-date">' . __( 'Recorded on' , 'seriously-simple-podcasting' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $data ) ) . '</span>';
break;

// Allow for custom items to be added, but only allow a small amount of HTML tags
Expand All @@ -411,11 +408,29 @@ public function episode_meta_details ( $episode_id = 0, $context = 'content' ) {
}
}

$meta_display .= "<p>".__( 'Podcast:', 'seriously-simple-podcasting' )." ".$podcast_display."</p>";

$itunes_url = get_option( 'ss_podcasting_itunes_url', '' );
if ( ! empty( $itunes_url ) ) {
$meta_display .= $meta_sep . '<a href="' . esc_url( $itunes_url ) . '" title="' . __( 'Leave a review', 'seriously-simple-podcasting' ) . '" class="podcast-meta-itunes">' . __( 'Leave a review', 'seriously-simple-podcasting' ) . '</a>';
$subscribe_display .= '<a href="' . esc_url( $itunes_url ) . '" target="_blank" title="' . apply_filters( 'ssp_subscribe_link_name_itunes', __( 'iTunes', 'seriously-simple-podcasting' ) ) . '" class="podcast-meta-itunes">' . apply_filters( 'ssp_subscribe_link_name_itunes', __( 'iTunes', 'seriously-simple-podcasting' ) ) . '</a>';
}

$stitcher_url = get_option( 'ss_podcasting_stitcher_url', '' );
if ( ! empty( $stitcher_url ) ) {
if( empty( $itunes_url ) ) { $meta_sep = ''; } else { $meta_sep = ' | '; }
$subscribe_display .= $meta_sep . '<a href="' . esc_url( $stitcher_url ) . '" target="_blank" title="' . apply_filters( 'ssp_subscribe_link_name_stitcher', __( 'Stitcher', 'seriously-simple-podcasting' ) ) . '" class="podcast-meta-itunes">' . apply_filters( 'ssp_subscribe_link_name_stitcher', __( 'Stitcher', 'seriously-simple-podcasting' ) ) . '</a>';
}

$google_play_url = get_option( 'ss_podcasting_google_play_url', '' );
if ( ! empty( $google_play_url ) ) {
if( empty( $stitcher_url ) ) { $meta_sep = ''; } else { $meta_sep = ' | '; }
$subscribe_display .= $meta_sep . '<a href="' . esc_url( $google_play_url ) . '" target="_blank" title="' . apply_filters( 'ssp_subscribe_link_name_google_play', __( 'Google Play', 'seriously-simple-podcasting' ) ) . '" class="podcast-meta-itunes">' . apply_filters( 'ssp_subscribe_link_name_google_play', __( 'Google Play', 'seriously-simple-podcasting' ) ) . '</a>';
}

if ( ! empty( $subscribe_display ) ) {
$meta_display .= '<p>' . __( 'Subscribe:', 'seriously-simple-podcasting' ) . ' ' . $subscribe_display . '</p>';
}

$meta_display = '<div class="podcast_meta"><aside>' . $meta_display . '</aside></div>';

return $meta_display;
Expand Down Expand Up @@ -1286,4 +1301,15 @@ public function feed_content_type ( $content_type = '', $type = '' ) {
public function load_localisation () {
load_plugin_textdomain( 'seriously-simple-podcasting', false, basename( dirname( $this->file ) ) . '/languages/' );
}

/**
*
*/
public function load_scripts(){

wp_register_style( 'ssp-frontend-player', $this->assets_url.'css/player.css', array(), $this->version );
wp_enqueue_style( 'ssp-frontend-player' );

}

}
52 changes: 36 additions & 16 deletions includes/class-ssp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ private function settings_fields() {
array(
'id' => 'explicit',
'label' => __( 'Explicit', 'seriously-simple-podcasting' ),
'description' => __( 'Mark if your podcast is explicit or not.', 'seriously-simple-podcasting' ),
'description' => sprintf(__( 'To mark this podcast as an explicit podcast, check this box. Explicit content rules can be found %s.', 'seriously-simple-podcasting' ), '<a href="https://discussions.apple.com/thread/1079151">here</a>'),
'type' => 'checkbox',
'default' => '',
'callback' => 'wp_strip_all_tags',
Expand All @@ -744,21 +744,21 @@ private function settings_fields() {
'options' => array( 'published' => __( 'Published date', 'seriously-simple-podcasting' ), 'recorded' => __( 'Recorded date', 'seriously-simple-podcasting' ) ),
'default' => 'published',
),
/**
* New iTunes Tag Announced At WWDC 2017
*/
array(
'id' => 'consume_order',
'label' => __( 'Series Consume Order', 'seriously-simple-podcasting' ),
'description' => __( 'The order in which you want your episodes to be consumed by iTunes', 'seriously-simple-podcasting' ),
'type' => 'select',
'options' => array(
'' => __( 'Please Select', 'seriously-simple-podcasting' ),
'episodic' => __( 'Latest Episode First', 'seriously-simple-podcasting' ),
'serial' => __( 'Oldest to Newest', 'seriously-simple-podcasting' )
),
'default' => '',
),
/**
* New iTunes Tag Announced At WWDC 2017
*/
array(
'id' => 'consume_order',
'label' => __( 'Show Type', 'seriously-simple-podcasting' ),
'description' => sprintf( __( 'The order your podcast episodes will be listed. %1$sMore details here.%2$s', 'seriously-simple-podcasting' ), '<a href="' . esc_url( 'https://www.seriouslysimplepodcasting.com/ios-11-podcast-tags/' ) . '" target="' . wp_strip_all_tags( '_blank' ) . '">', '</a>' ),
'type' => 'select',
'options' => array(
'' => __( 'Please Select', 'seriously-simple-podcasting' ),
'episodic' => __( 'Episodic', 'seriously-simple-podcasting' ),
'serial' => __( 'Serial', 'seriously-simple-podcasting' )
),
'default' => '',
),
array(
'id' => 'redirect_feed',
'label' => __( 'Redirect this feed to new URL', 'seriously-simple-podcasting' ),
Expand Down Expand Up @@ -787,6 +787,26 @@ private function settings_fields() {
'callback' => 'esc_url_raw',
'class' => 'regular-text',
),
array(
'id' => 'stitcher_url',
'label' => __( 'Stitcher URL', 'seriously-simple-podcasting' ),
'description' => __( 'Your podcast\'s Stitcher URL.', 'seriously-simple-podcasting' ),
'type' => 'text',
'default' => '',
'placeholder' => __( 'Stitcher URL', 'seriously-simple-podcasting' ),
'callback' => 'esc_url_raw',
'class' => 'regular-text',
),
array(
'id' => 'google_play_url',
'label' => __( 'Google Play URL', 'seriously-simple-podcasting' ),
'description' => __( 'Your podcast\'s Google Play URL.', 'seriously-simple-podcasting' ),
'type' => 'text',
'default' => '',
'placeholder' => __( 'Google Play URL', 'seriously-simple-podcasting' ),
'callback' => 'esc_url_raw',
'class' => 'regular-text',
),
),
);

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ You can find complete user and developer documentation (along with the FAQs) on
== Changelog ==

= 1.18.0 =
* 2017-09-28
* 2017-10-09
* [NEW] Added new and updated iTunes tags to podcast feed as announced at WWDC2017
* [NEW] Added new and updated iTunes tags as episode settings in current meta box
* [NEW] Added new and updated iTunes tags as series specific settings podcast settings area
* [NEW] Added Stitcher and Google Play subscription links
* [TWEAK] Removed duration from beneath the player
* [TWEAK] Fixed the wording of the explicit checkbox (props [Ken Andries](https://github.com/Douglasdc3))

= 1.17.3 =
* 2017-08-29
Expand Down
2 changes: 1 addition & 1 deletion seriously-simple-podcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
return;
}

define( 'SSP_VERSION', '1.17.3' );
define( 'SSP_VERSION', '1.18.0' );
define( 'SSP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SSP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );

Expand Down

0 comments on commit 81c9ac4

Please sign in to comment.