Make WordPress Core

Opened 3 weeks ago

Last modified 3 weeks ago

#50681 new defect (bug)

default-filters.php contains non-tweakable parameters

Reported by: rsepierre Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Media Keywords: has-patch
Focuses: coding-standards Cc:


'default-filters.php' should NEVER use the "plugins-loaded" hook.
The reason being that this removes EVERY THEME DEVELOPER any kind of power around that setting.
Those "default filters" becomes "definitive and non editable filter" for theme developers.

For me this breaks my custom image size workflow

The best hook to replace "plugins-loaded" (according to wordpress's own documentation) would be "init"

add_action( 'plugins_loaded', '_wp_add_additional_image_sizes', 0 );

Also I don't understand why image sizes can't be more simple and centralized.
"thumbnail, medium, large" are treated as wordpress option and are user editable
"medium_large" is treated as an non-user-editable invisible wordpress option
NEW "big_image_size_threshold" which is a filter and basically a new image size (messes up the different image sizes names by the way)
NEW "1536x1536 and 2048x2048" that are hooked before any theme developers can access it which makes them non-editable for users and theme developpers.

The latest two (1536 and 2048) are indeed "plugin developpers" editable IF those plugin developers are willing to use bad practice and go for the "plugins-loaded" hook instead of the "init" hook.

This is breaking change for EVERY THEME DEVELOPPER and encourages bad practice for plugins developpers to interract with it.

This is very bad because EVERY DEVELOPPER should manages and have full control over his image sizes pipeline and avoid the default one at all costs. It's getting clunkier, less functionnal and more bloated with each update. It is really simple to fix but wordpress is really going the other way around and now preventing developers from working with it.

Change History (2)

This ticket was mentioned in PR #408 on WordPress/wordpress-develop by rsepierre.

3 weeks ago

  • Keywords has-patch added; needs-patch removed

#2 @SergeyBiryukov
3 weeks ago

  • Component changed from Options, Meta APIs to Media
  • Severity changed from blocker to normal
  • Version changed from 5.4.2 to 5.3

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Just noting that this was added in [46066] / #43524.

Note: See TracTickets for help on using tickets.