[wp-trac] [WordPress Trac] #32137: Allow user-specified default image size when inserting image via Press This
WordPress Trac
noreply at wordpress.org
Wed Jun 17 22:48:40 UTC 2015
#32137: Allow user-specified default image size when inserting image via Press This
--------------------------+------------------------------
Reporter: topdownjimmy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Press This | Version: 4.2
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by azaozz):
Couple of notes:
- To do this properly (restrict the inserted image size) we will need to
restrict it when first inserted, from JS. Otherwise the user will see the
"full" image in Press This, and it will be replaced with the "default"
size on saving. That difference can be pretty large, and definitely
unexpected.
- The option `image_default_size` hasn't been used for years. As far as I
remember it is a left over from the old media modal, pre 3.5. Perhaps we
could use `get_user_setting('imgsize')` which is the size the user
selected when last inserting an image into the editor. However there's no
way for the user to change that size in PT.
In that terms the current workflow seems better: insert the full image
size (as found on the source site), and replace it with the same size on
saving. If the user likes to change it, that can be done from the Edit
Post screen in wp-admin, same as the rest of the more advanced settings.
Looking at 32137.7.patch, it seems like a good idea to return the
attachment id from `media_sideload_image()`, then do
`wp_get_attachment_image()` so the image tag has the proper class, etc.
Then plugins will be able to use several of the image filters to change
size or other attributes for the replacement image tag.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32137#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list