Skip to content

Commit

Permalink
Merge pull request #35 from WP-for-Church/dev
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
Nikola Miljković authored Apr 18, 2017
2 parents 0f91ca1 + ea15344 commit 047e1d7
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 34 deletions.
9 changes: 9 additions & 0 deletions css/bibly.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/plyr.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 22 additions & 13 deletions includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,32 @@ function wpfc_sermon_media() {
} elseif ( ! get_wpfc_sermon_meta( 'sermon_video' ) && ! get_wpfc_sermon_meta( 'sermon_video_link' ) && get_wpfc_sermon_meta( 'sermon_audio' ) ) {
$html = '';
$html .= '<div class="wpfc_sermon-audio cf">';
$mp3_url = get_wpfc_sermon_meta( 'sermon_audio' );
$attr = array(
'src' => $mp3_url,
'preload' => 'none'
);
$html .= wp_audio_shortcode( $attr );
$html .= wpfc_render_audio( get_wpfc_sermon_meta( 'sermon_audio' ) );
$html .= '</div>';

return $html;
}
}

/**
* Renders the audio player
*
* @param string $url The URL of the audio file
*
* @return string Audio player HTML
*/
function wpfc_render_audio( $url = '' ) {
if ( ! is_string( $url ) || trim( $url ) === '' ) {
return '';
}

$output = '<audio controls>';
$output .= '<source src="' . $url . '">';
$output .= '</audio>';

return $output;
}

// legacy function
function wpfc_sermon_files() {
do_action( 'sermon_media' );
Expand All @@ -336,12 +350,7 @@ function wpfc_sermon_files() {
function wpfc_sermon_audio() {
$html = '';
$html .= '<div class="wpfc_sermon-audio cf">';
$mp3_url = get_wpfc_sermon_meta( 'sermon_audio' );
$attr = array(
'src' => $mp3_url,
'preload' => 'none'
);
$html .= wp_audio_shortcode( $attr );
$html .= wpfc_render_audio( get_wpfc_sermon_meta( 'sermon_audio' ) );
$html .= '</div>';

return $html;
Expand All @@ -368,7 +377,7 @@ function wpfc_sermon_attachments() {
}
}
if ( get_wpfc_sermon_meta( 'sermon_audio' ) ) {
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-audio"></span>' . __( 'MP3', 'sermon-manager' ) . '</a>';
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_audio' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-audio" download="true"></span>' . __( 'MP3', 'sermon-manager' ) . '</a>';
}
if ( get_wpfc_sermon_meta( 'sermon_notes' ) ) {
$html .= '<a href="' . get_wpfc_sermon_meta( 'sermon_notes' ) . '" class="sermon-attachments"><span class="dashicons dashicons-media-document"></span>' . __( 'Notes', 'sermon-manager' ) . '</a>';
Expand Down
1 change: 1 addition & 0 deletions includes/types-taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ function wpfc_sermon_metaboxes() {
'desc' => __( 'Select the type of service. Modify service types in Sermons -> Service Types.', 'sermon-manager' ),
'id' => 'wpfc_service_type',
'type' => 'select',
'show_option_none' => true,
'options' => cmb2_get_term_options( 'wpfc_service_type' ),
) );
$cmb->add_field( array(
Expand Down
Loading

0 comments on commit 047e1d7

Please sign in to comment.