WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 3 weeks ago

#46052 new defect (bug)

Classic Editor lacks (previously working) ability to remember media preferences

Reported by: ordresser Owned by:
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Media Keywords: close reporter-feedback
Focuses: Cc:

Description

I seem to remember that before when you changed the settings for adding an image inside your post (set it to center, large, link to ‘media file’) it would have that set next time you set an image.

However, now it seems that isn’t working, and instead every time I add an image it’s set to no alignment, no link to anything.

Is this something caused by the lastest update? Is there a way to make WordPress remember my image preferences?

Classic editor. A single image.

I’ve also been doing galleries, and the same issue is there too, where it doesn’t remember I want 8 images and link to media file. But I’m more bothered by the single image thing. I’m not sure if WordPress ever remembered gallery preferences, but I’m pretty sure it did remember ‘add media’ settings for non-gallery media.

https://wordpress.org/support/topic/how-to-make-wordpress-remember-image-settings/#post-11108725

Change History (6)

#1 @desrosj
4 weeks ago

  • Component changed from General to Media

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


4 weeks ago

#3 @desrosj
4 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.2.2

Thanks for reporting this, @ordresser! And welcome to Trac!

I am moving this to the 5.2.2 milestone to explore further. This setting also exists in the block editor. This should be tested thoroughly to understand the full extent of the issue.

Related: #31467.

#4 @desrosj
3 weeks ago

  • Keywords close reporter-feedback added; needs-testing removed

I did some testing on this today.

The image_default_link_type option is used to control the preferred image Link To value. This can be set to three values: none (default for new installs since WordPress 2.7 according to the database schema), file, or post.

For galleries, the proper way to override the default Link To value is using the media_view_settings filter to add galleryDefaults to the list of settings (filter documentation).

These are the results of my testing:

  • While using the block editor with the image block, the option is not respected in the Link To field.
  • When using the block editor with the Classic Editor block to insert an image, the option is respected in the Link To field.
  • While using the block editor with the gallery block, the default Link To value is not respected.
  • When using the block editor with the Classic Editor block to insert a gallery, the default value is respected.
  • When using the Classic Editor plugin, both plugins and images correctly respect the methods above.

I went back and tested version 4.9 (before the block editor was merged) and I could not reproduce the behavior you describe. After inserting an image or gallery, if the Link To is changed, the value will persist on that specific image but nowhere else. I couldn't find any code indicating this was the case.

@ordresser is it possible that you had a plugin active that would remember the preference on a per user basis? Or, had you modified the image_default_link_type at some point?

Because I can't reproduce the behavior described in earlier versions, I am going to mark this as a close candidate. If @ordresser is able to provide more details showing that link preference was remembered by default in Core, it can be investigated further.

I have opened GitHub-15865 to investigate situations where these filters are not respected in the block editor.

#5 @desrosj
3 weeks ago

  • Milestone changed from 5.2.2 to 5.3

I still recommend this be closed. However, I am going to move this out of the 5.2.2 milestone to allow more time for further testing and feedback.

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.