Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #46635, comment 30


Ignore:
Timestamp:
08/23/2024 05:17:16 PM (11 months ago)
Author:
jason_the_adams
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46635, comment 30

    initial v1  
    11I would also love to see this reach the finish line. I think your summary is good, @joehoyle. I an see issues in adding the 4th parameter that make backwards compatibility difficult, which leans me towards @schlessera's suggestion. I do acknowledge that the class-based route is a bit more complex, but I like the idea of encapsulating callbacks within an invokable class, which is something we often do anyway.
    22
    3 The only change I'd make to the class approach would be to make `RemovableClass` both an interface (with more distinct properties/methods) _and_ a final class. That way folks could return a custom class that implements the interface and handles the callback.
     3The only change I'd make to the class approach would be to make `RemovableClass` both an interface (with more distinct properties/methods) ''and'' a final class. That way folks could return a custom class that implements the interface and handles the callback.