Media Library, hook on delete user action

A more appropriate hook may be delete_attachment($post_id). You may also need to hook edit_attachment. Note that the post_id is that of the attachment type post, not the page/blog post to which the media is attached (if any). In case you want to know when media is added, hook add_attachment($post_id). Note that add_attachment is called before … Read more

attachment media-template data model (data.size.url)

Problem fixed: I was not sending all properties (and didn’t find a list of possible properties) that the media_template expects. Finally I ended up alerting the data object by doing this (last 6 lines), where I first checked out ‘data’, and then each [object, object] that was returned (such as data.size) <script type=”text/html” id=”tmpl-attachment”> <div … Read more