Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Display / Echo friendlier MIME-type names in WordPress

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38170
    jonedwards
    Participant

    I am using a simple function to pull all PDF and MSWord documents attached to a post (a custom post-type) and return them in an unordered list for download, like so:





    Simple enough. But the outputted HTML return “Download XYZ Document Title (application/pdf)”.

    I want it to return a ‘friendlier’ name for the file type, like so, “Download XYZ Document Title (PDF)”

    Is there any way to achieve this?

    Thanks in advance for any help.

    #103278
    jonedwards
    Participant

    Hey Traq. Thanks for the reply.

    I’ve only ever used a translate function to change “Posts” to say “Articles”… But even that was from a tutorial.

    Any hints / snippets?

    #103280
    jonedwards
    Participant

    Hi Traq

    My code above resides in archive-downloads.php

    I am echo-ing the resulting text, not printing.

    Feel a bit stupid right now… Where are you suggesting your snippet should go – functions.php? Also, how does the “print friendly_mime” but fit in..?

    #103311
    jonedwards
    Participant

    Aaaah…

    Thanks Traq and Schmotty – worked like a charm and I’ve learnt something new.

    Cheers

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.