Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #46635, comment 18


Ignore:
Timestamp:
04/03/2019 09:40:37 PM (6 years ago)
Author:
schlessera
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46635, comment 18

    v1 v2  
    11I forgot to mention two things:
    22
    3 - Yes, the `RemovableClosure` is a `callable` to PHP, so it will just behave as a regular Closure, or any other callable.
     3- Yes, the `RemovableClosure` is a `callable` to PHP (due to the presence of `__invoke()`), so it will just behave as a regular Closure, or any other callable.
    44- We can still provide a convenience function, like `add_closure_action( $hook, $id, $closure, $priority, $num_args )` to hide the object instantiation. This can be done without BC break.