WordPress.org

Ready to get started?Download WordPress

Forums

WordPress function to create enclosure? (4 posts)

  1. dholowiski
    Member
    Posted 3 years ago #

    I'm writing a plugin that gets an MP3 URL from another server, and appends it to the end of the post using the the_content filter.
    But what I really want is to add the MP3 with a media enclosure, so the RSS feed looks like a podcast. Is there any WordPress function which will take a URL and generate an enclosure for me, or do I have to do it on my own?
    I did try searching the codex but couldn't find what I was looking for.

  2. dholowiski
    Member
    Posted 3 years ago #

    I couldn't figure this out, other than creating the enclosures (and modifying the RSS feed) myself - more programming than I want to do right now.

    In case anybody is wondering how I solved this, I simply installed the Blubrry PowerPress plugin, and did a do_shortcode([powerpress url=\"$mp3_address\"]); which handles all the podcasting magic for me.

  3. dholowiski
    Member
    Posted 3 years ago #

    Well... that inserts the player, but doesn't do the podcast magic.
    Turns out I spent a day over-thinking the problem. WordPress creates the podcast enclosure from a custom field called 'enclosure'. So all you do is update the enclosure field to have the URL of your MP3
    update_post_meta($post_ID,"enclosure",$mp3_address);

  4. Jason Paul
    Member
    Posted 3 years ago #

    I can't figure out how to control the text title of the mp3 enclosure. It outputs the entire link to the url visibly where i'd like it to pick it up from the Title. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags