Anthony Martin
Forum Replies Created
-
Forum: Plugins
In reply to: [Media Library Assistant] Add Hook for icon mediaHi David,
Thanks for your response.
There is indeed a hook in the standard function
wp_get_attachment_image()
, but all my pdf don’t go in this hook because in the functionwp_get_attachment_image
, they don’t have image src..But, I hook into function
wp_get_attachment_image_src()
and I get the good result !
This is how I make, if someone is interested :if(!function_exists('sp_change_icon_pdf_media')){ function sp_change_icon_pdf_media($image, $attachment_id, $size, $icon){ global $pagenow; if(!is_admin() && $pagenow != 'upload.php') return $image; $mime_type = get_post_mime_type($attachment_id); if($mime_type == 'application/pdf'){ // Do stuff $url = 'https://www.domain.com/test.jpg'; } else $url = ''; return array($url, 64, 64, $icon); } add_filter('wp_get_attachment_image_src', 'sp_change_icon_pdf_media', 10, 4); }
Thanks again David,
AnthonyForum: Plugins
In reply to: [Media Library Assistant] Edit box "Inserted in"Hi David,
Thanks for the copy.
I test it, and you do a great job for this news hooks !!But I have one question.
It is possible to remove textarea for metabox ? Because, when I want to add some HTML and CSS in this text, I can’t and my tag are visible and not understand by the browser…
Do you see what I mean ?(this is a screenshot for understand my problem)
Forum: Plugins
In reply to: [Media Library Assistant] Edit box "Inserted in"Hi David,
Thanks for your answer and your development.
I send you a email and I’m a hurry to test the new version of this plugin ! ??
Thanks you very much
Forum: Plugins
In reply to: [Media Library Assistant] Edit box "Inserted in"Very nice ! I wait this update with impatience.
Thanks you