FIle Upload Custom Field & Shortcode

This topic contains 4 replies, has 3 voices, and was last updated by  Stiofan O’Connor 7 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #375953

    Paul Ceppaglia
    Expired Member
    Post count: 29

    Hi,

    I’ve searched the forum, and found some entries addressing shortcodes and custom fields, but I haven’t been able to figure this out, so I’m posting a new topic…

    I have created a File Upload custom field, which will allow users to upload an audio file (MP3, Wav, etc.).

    The Front End Display is “Audio Samples”

    The HTML Variable Name is “audio”

    This displays as its own tab (called, of course, “Audio Samples”) within the listing detail.

    Currently, when a listing has an audio file upload, the Audio Samples tab simply displays the filename as clickable text (i.e. to download the file). For example, if somebody uploads sample.mp3, then on the Audio Samples tab it displays:

    Audio Samples:

      sample.mp3

    What I would like to do is wrap the filename in the built-in WordPress [audio] shortcode, so that instead of displaying the filename, it would display the file(s) in an audio player.

    The shortcode that would need to be inserted into the tab would be:

    [audio src="https://path/to/audio/sample.mp3"]

    I’ve seen this post: https://wpgeodirectory.com/formidable-forms-in-geodirectory-tabs/ and it looks like I might be able to adapt that code…but I’m just wondering if my assumption is correct?

    Any help would be greatly appreciated!

    #375998

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    Yes if you add the tab programmatically, that should be possible.

    You can also see this post: https://wpgeodirectory.com/add-a-new-tab-in-the-listing-detail-page/

    Thanks

    #376006

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Paul,

    We have decided to make this show the player by default, if u can replace this file in your GD core plugin it should work: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/custom_fields_output_functions.php

    Thanks,

    Stiofan

    #376023

    Paul Ceppaglia
    Expired Member
    Post count: 29

    Excellent! That works perfectly! Thanks for your quick response and resolution!

    #376120

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket