[wp-trac] [WordPress Trac] #64209: Allow abilities to be deprecated

WordPress Trac noreply at wordpress.org
Fri Nov 7 15:59:27 UTC 2025


#64209: Allow abilities to be deprecated
--------------------------+---------------------
 Reporter:  jorbin        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.9
Component:  AI            |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by jorbin):

 In general, I think that deprecated abilities should still be callable,
 but not as discoverable. A handful of ideas for this:

 1. @gziolo
 [https://wordpress.slack.com/archives/C08TJ8BPULS/p1762439802995989?thread_ts=1762359278.559289&cid=C08TJ8BPULS
 suggested not including deprecated abilities by default] when calling
 `wp_get_abilities()`

 > We support meta.show_in_rest to decide whether to expose the ability in
 REST API. I think it would make perfect sense to offer meta.deprecated
 which would remove the ability from wp_get_abilities() return set. At the
 same time, it should still be possible to get a deprecated ability, but we
 can log that fact when calling wp_get_ability() or at any other stage that
 makes the most sense.


 2. Building on that, I think a new `_deprecated_ability` function could be
 added so that if you call `‎WP_Ability::do_execute‎` on a deprecated
 ability, it could trigger a loggable error. Though I could also see this
 as being the responsibility of what is registered for the callback.

 3. I think `meta.deprecated` would be false by default or it could be a
 string that would be

 4. When calling the `wp-abilities/v1/abilities` endpoint, an optional
 `deprecated` argument could be added which will make the deprecated
 abilities visable. Otherwise, it would be hidden.

 5. I don't think `_deprecated_function` makes sense unless the actual
 function is being deprecated. Image an ability who's callback is a
 function used elsewhere that is not deprecated but there is a desire to
 replace it with something more robust and to do so in a way that keeps
 compatibility with the original ability.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64209#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list