WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Manage Upload Types] Suggestion: specific embedding code

[Resolved] [Plugin: Manage Upload Types] Suggestion: specific embedding code

  • Good morning!

    I should tell you that I am a chemist and I would like to easily insert files of the type “.cdx”, a specific chemical format, directly with the media insert tool.

    Can I make the following suggestion: would it be possible for the user of your plugin to also define a specific code to embed the file url?

    Best regards,
    Michel

    Example:
    the file “123.cdx”, after having been uploaded, gets the following url:

    http://localhost:8888/test_wp_20120525/wp-content/uploads/2012/05/123.cdx

    which still needs to be embedded in the following code:

    <script>
    cd_insertObjectStr("<EMBED src='http://localhost:8888/test_wp_20120525/wp-content/uploads/2012/05/123.cdx' align='baseline' border='0' width='274' height='128' type='chemical/x-cdx' name=cd2>");
    </script>

    http://wordpress.org/extend/plugins/manage-upload-types/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author jmadea
    Member

    @jmadea

    Michel,

    I’m sorry to have taken so long to answer. I just noticed the comment you posted on my site about a week ago.

    In answer to your question, I really don’t think that falls within the scope of this plugin. The point of this is only to allow or disallow uploads with given file extensions through the media library. This plugin doesn’t (and shouldn’t) make assumptions about what needs to be done to use those files once they are uploaded.

    Kind regards,
    -j

    Thanks for your answer!
    Do you have an idea where to find the php code which determines which code must embed the file name, in function of the file extension?

    Plugin Author jmadea
    Member

    @jmadea

    I don’t think that what you are looking for exists, exactly. WP has some built-in support for common media types, but I don’t think there’s one place where the code used to embed them in a page is chosen based on file extension (or anything else.) Some media types aren’t ever embedded in a page and others could be embedded multiple ways.

    I don’t think that doing what you want with a new (i.e. currently unsupported) media type would be very difficult. However, not having needed to do this myself, I can only make some wild guesses at how to start going about it. My first thought is that a custom post type might be in order; but on reflection, I’m not really sure that’s necessary. The standard “attachment” post type with a custom taxonomy may be the right approach. Some research is in order. I’d check around to see how people may be embedding other types.

    I’m sorry I can’t be of more help. Good luck with it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Manage Upload Types] Suggestion: specific embedding code’ is closed to new replies.