-
Notifications
You must be signed in to change notification settings - Fork 0
For Developers: Sermon Post Type
The sermon post type is the center of this plugin's functionality. The post-type has several associated taxonomies and custom fields for building out your sermon archive.
GC Sermons comes with a GCS_Sermon_Post WP_Post wrapper class specifically for posts in the Sermon post-type.
You can get an instance of this class using the gc_get_sermon_post( $post_id ) helper function.
$sermon = gc_get_sermon_post( $sermon_identifier );
-
$sermon_identifiercan use$sermon->ID,$sermon->post_name,$sermon->post_date, etc. All of these works as normalWP_Postparameters.
$video_player = $sermon->get_video_player( $args = array() );
$audio_player = $sermon->get_audio_player();
$permalink = $sermon->permalink();
$title = $sermon->title();
$excerpt = $sermon->loop_excerpt();
$featured_image = $sermon->featured_image( $size = 'full', $attr = '' );
-
$size- Optional. Image size to use; accepts any valid image size or an array of width and height values in pixels. -
$attr- Option. Query string or array of attributes.
$series_image = $sermon->series_image( $size = 'full', $attr = '' );
- Uses same parameters as above.
$speaker = $sermon->get_speaker( $args = array() );
-
$args= Passed toGCS_Taxonomies_Base::get().
$sermon = $sermon->get_series( $args = array() );
-
$args= Same as above.
$others_in_series = $sermon->get_others_in_series( $args = array() );
-
$args- Array ofWP_Queryarguments. -
Returns:
WP_Queryinstance.
$others_by_speaker = $sermon->get_others_by_speaker( $args = array() );
-
$args- Array ofWP_Queryarguments. -
Returns:
WP_Queryinstance.
$series = $sermon->series();
- Wraps:
get_the_terms - Returns: Array of series terms
$speakers = $sermon->speakers();
- Wraps:
get_the_terms - Returns: Array of speaker terms
$topics = $sermon->topics();
- Wraps:
get_the_terms - Returns: Array of topic terms
$tags = $sermon->tags();
- Wraps:
get_the_terms - Returns: Array of tag terms
$meta = $sermon->get_meta( $key );
-
$key- Required. Key of desired meta data. - Wraps:
get_post_meta - Returns: Value of sermon meta