I'm trying to add a filter to the add media button for a custom post type. I'm using add_filter('media_send_to_editor') and it work's fine, but I'm having difficulty finding a way to determine the post type of the admin page so that I can only perform the filter on that specific post type. Any ideas on how I can get the post post type?
I'm trying to filter the output of the image and caption, but I only want to do it on a specific post type. I would need the other post types to function as normally when adding images. I need the the image to be wrapped in a shortcode and the caption to be included in a parameter for that shortcode. I have it working. I just need a way to make it conditional for post types.