[wp-trac] [WordPress Trac] #50681: default-filters.php contains non-tweakable parameters

WordPress Trac noreply at wordpress.org
Thu Jul 16 13:43:50 UTC 2020


#50681: default-filters.php contains non-tweakable parameters
--------------------------------+-----------------------------
 Reporter:  rsepierre           |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  5.4.2
 Severity:  blocker             |   Keywords:  needs-patch
  Focuses:  coding-standards    |
--------------------------------+-----------------------------
 '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"

 ------ The Faulty line is in default-filters.php (l-526)-----------------

 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50681>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list