I have several different posts type, each with a media upload. What I want to do is to rename the “insert into post” button so it correlates to the individual custom-posts. For example – custom post type – “award” and then the media upload box would have the following button, “insert into award”.
Any ideas?
I think, this is not so easy possible, on the media-page in Admin-area is it not possible to check the post_type of your CPT. Normaly you can change strings with the follow small source, an example.
But it is important, that you check, on wich page is the author in admin and on the iframe of the media page it is not possible to read the post_type; maybe you find this var and then it is possible with the example source.
[update]
I took a silly approach at first and am completely rewriting my answer due to this Stephen Harris’ post. Result: it is much more compact now.
I tried to adapt @bueltge’s filter into my code, but didn’t succeed.
My solution uses jQuery to manipulate the strings.
In the From Computer tab I’m adding a function to run every half second to be able to change the button text when it appears (after uploading).
This example deals with 2 CPTs: “movie” and “woo_estate”.