Skip to content

Feature Request: Public Function to return audio url. #308

@regiside

Description

@regiside

I realize this plugin doesn't have a maintainer at the moment, but if anyone ever picks it back up or decides to fork it, It would be nice if the following code was turned into a function that could be accessed by theme developers and even internally across the plugin as the same or similar code is repeated in multiple view, and in the rss feeds.

The code is used to check if the sermon audio url is a wordpress attachment or an external link and if it's a wordpress attachment return that instead of a hard coded value from the database.

$sermon_audio_id = get_wpfc_sermon_meta( 'sermon_audio_id' ); $sermon_audio_url_wp = $sermon_audio_id ? wp_get_attachment_url( intval( $sermon_audio_id ) ) : false; $sermon_audio_url = $sermon_audio_id && $sermon_audio_url_wp ? $sermon_audio_url_wp : get_wpfc_sermon_meta( 'sermon_audio' );

It would be nice if there was a "get_wpfc_sermon_audio_url" which would return either the wordpress attachment url or the saved database string if it wasn't an attachment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions