[wp-trac] [WordPress Trac] #48477: Add a hook before creating image sub-sizes
WordPress Trac
noreply at wordpress.org
Thu Nov 21 21:34:28 UTC 2019
#48477: Add a hook before creating image sub-sizes
-------------------------------------------------+-------------------------
Reporter: GregLone | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.3.1
Component: Upload | Version: 5.3
Severity: normal | Resolution:
Keywords: has-patch needs-testing 2nd-opinion | Focuses:
reporter-feedback |
-------------------------------------------------+-------------------------
Comment (by GregLone):
Replying to [comment:6 azaozz]:
> Currently there are (at least) three hooks fired right after a file was
uploaded:
The idea is not to have a hook that triggers after a file is uploaded but,
as the hook’s name suggests, before sub-sizes are created. The difference
is that it can happen even if the file wasn’t just uploaded: when a plugin
regenerates thumbnails for example.
Currently I’m also thinking adding one after the sub-sizes are created and
recorded in the database, maybe at the end of
`wp_update_attachment_metadata()`, with an additional context argument
(`create`/`update`), like you suggested recently if I remember well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48477#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list