[resolved] plugin button to insert a shortcode (not a link) from media_upload / library tab (2 posts)

  1. OllieJones
    Posted 3 years ago #

    Working on a plugin.
    I'd like to add a button to the library tab of the media_upload page to insert a shortcode. It's an [audio ] shortcode.

    This plugin attempts the same thing, but it stopped working a few versions of wp ago.


    This discussion covers how to make something work


    But what works is the insertion of a corrupt hyperlink : you can't say href="[shortcode'" and expect anything to work.

    If you know a good way to insert a program-generated shortcode, that would be very helpful.

  2. OllieJones
    Posted 3 years ago #

    I figured this out. There's a filter not listed in the codex called media_send_to_editor. Using this filter a plugin programmer can intervene in the data sent from the media manager to the post / page editor.

Topic Closed

This topic has been closed to new replies.

About this Topic