I have downloaded an audio player plugin for WP. the syntax is very simple. You just add the line : “[audio:my_file.mp3]” to your post editor/excerpt, and call it in the loop with the_content() or the_excerpt() respectively.
I would like to build a metabox in which the user would upload a file, and the plugin syntax would automatically be generated accordingly. I know how to insert the meta-data into the DB, but pulling it with get_post_meta() or the_meta() just gets the syntax as it is, without replacing it with the desired plugin content (i.e the audio player).
I thought about dynamically injecting the syntax to the editor\excerpt with the use of the filter default_content but this filter only applies to normal posts, whereas mine is a custom post type (audio).
your ideas are most welcomed.
I have downloaded an audio player plugin for WP. the syntax is very simple.
Share
Solved. used the_content filter, which allows you to inject content directly from the code: