Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Use Featured Images #37

Open
MatthewEppelsheimer opened this issue Oct 7, 2014 · 3 comments
Open

Use Featured Images #37

MatthewEppelsheimer opened this issue Oct 7, 2014 · 3 comments

Comments

@MatthewEppelsheimer
Copy link

@ericmann are you open to a PR with a refactor to use the featured image API for publications, and standard thumbnail sizing functions in output?

The plugin's current approach with thumbnails is unique. We have a client with huge images associated with publications. We need to reduce their size to reduce bandwidth. If the plugin used standard thumbnail sizing functions, this would be trivial. As is, it's a bit tricky.

I figured we check in before diving into this, in case there are advantages of the current this refactor would erase, or if you already have a plan in mind for this.

@MatthewEppelsheimer
Copy link
Author

A bit more context may be helpful.

The way wp-publication-archive currently handles publication thumbnails is to store links to images as postmeta, instead of as as featured images. On output, it doesn't generate thumbnails, which are processed through WP's image sizing functions, but simply links to them.

I started to tackle this and got a few hours in before realizing this is complicated enough that it's worth a discussion.

As near as I can tell, the plugin stores the file path instead of the attachment ID, which means we can't run the sizing helper functions that get_the_post_thumbnail() uses, because they take attachment ID parameters.

Furthermore, an upgrade script will be required to find attachment IDs given media file paths (that might be impractical) and then use that to update posts with featured image data.

@MatthewEppelsheimer
Copy link
Author

CC @KevinLenihan

@ericmann
Copy link
Owner

ericmann commented Oct 8, 2014

I'd be perfectly OK with that. The first run of the plugin long pre-dates featured images, and I've just never had the time to refactor things to use them. I'm definitely open to a pull request 👍

@ericmann ericmann closed this as completed Oct 8, 2014
@ericmann ericmann reopened this Oct 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants