Skip to content

Commit

Permalink
Add additional function parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Nov 5, 2018
1 parent e19a7b4 commit 3cfbe33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions includes/sm-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,16 @@ function wpfc_sermon_meta( $meta_key = '', $before = '', $after = '' ) {
/**
* Return single sermon meta key content from inside a loop.
*
* @param string $meta_key The meta key name.
* @param string $meta_key The meta key name.
* @param WP_Post|null $post The sermon post object.
*
* @return mixed|null The meta key content/null if it's blank.
*/
function get_wpfc_sermon_meta( $meta_key = '' ) {
global $post;
function get_wpfc_sermon_meta( $meta_key = '', $post = null ) {
if ( null === $post ) {
global $post;
}

$data = get_post_meta( $post->ID, $meta_key, true );
if ( '' !== $data ) {
return $data;
Expand Down

0 comments on commit 3cfbe33

Please sign in to comment.