WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38323, comment 35


Ignore:
Timestamp:
11/13/2017 01:24:44 AM (3 years ago)
Author:
flixos90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38323, comment 35

    initial v1  
    11[attachment:38323.4.diff] is a refreshed patch based on [attachment:38323.diff]. @kadamwhite and I recently revisited this ticket and agreed that, for the first iteration the patch should remain simple to focus on the functionality. We could still add a class structure to some of it at a later stage, if it makes sense.
    22
    3 Compared to the original things the following things are changed:
     3Compared to the original patch the following things are changed:
    44
    55* The new function `get_object_subtype()` now uses logic that is currently part of `map_meta_cap()` already. I just noticed that while reviewing, so apparently this part of core still supports object subtypes already (maybe this was overlooked in the revert [38095]?). Anyway, that's good for us - I took the logic from there and put it in the new function, which as mentioned before is now also used by several other metadata functions that interact with an object ID. In addition, there's a new filter `get_object_subtype_{$object_type}` that allows devs to enhance the function for custom object types they might possibly have built (think about a custom database table where each object has an ID and the core metadata API should be used to extend it with arbitrary additional data).