Hooking into the Media Library template and Custom Post Edit screen, Meta Column
-
I’m trying to hook into and filter a few things in my template and am having difficulty finding out how to do so after much scouring of the web.
1) Need to hook into the Admin Media Library thumbnail
src
(the File column) so I can modify the path of the images without usingimage_size
. I won’t get into why, I just need to be able to programmatically change what image is being fetched because the images are not being stored in the media library. Due to naming conventions, I can easily do this as long as I know how to get thesrc
so I can modify it and then need to make sure it’s replaced before the thumbnails are loaded.2) I need to hook into a custom post type edit screen Featured Image
src
to do the same as the above, so instead of using the defaultsrc
it will use my modified path to the image to display.3) I also need to hook into custom fields for attaching media and do the same—src manipulation. I use a plugin from github to generate the metaboxes (fieldmanager), so I will contact those devs as well, but I’m guessing they use standard code for adding the metaboxes and displaying attached media previews.
4) I also can’t find how to sort a custom column for a CPT by another CPT meta key. In brief, CPT A is fetching a list of all posts of CPT B and displaying them in a select menu as a custom field and storing that selection as metadata. I’m loading the titles of CPT B into a custom column in the post list of CPT A. I need to sort those titles alphabetically, but the only way that seems possible is if I can also query CPT B custom meta field I created that provides a single word for sorting. Would appreciate a point in the right direction for how to accomplish this. Have been searching for months for how to do this.
5) Using custom icons for PDFs and Text files is bugged in the Media Library list view, throws errors and displays no image (it looks in the core path for the icons instead of the path provided using wp_mime_type_icon function). Grid view works fine. Not sure if this is being tracked, but figured I’d mention it.
- The topic ‘Hooking into the Media Library template and Custom Post Edit screen, Meta Column’ is closed to new replies.