Changes between Version 3 and Version 4 of Ticket #35658, comment 63
- Timestamp:
- 06/28/2016 02:29:01 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35658, comment 63
v3 v4 11 11 So instead please consider creating a combined type in one string in the form "{type}:{subtype}", or just "{type}" which defaults "{subtype}" to "any". 12 12 13 I have created an updated patch as [/attachment/ticket/35658/35658.5.diff 35658.5.diff] that adds a `WP_Object_Type` class to WordPress core. It has a `__toString()` method so it can be used as a string. Using this class makes it easy to add subtype support in a backward compatible way to any functions that currently support a post type or other type and it gets rid of duplicate code like the following from the patch because it makes it the responsibility of the `WP_Object_Type` object to police itself: 13 I have created an updated patch as [/attachment/ticket/35658/35658.5.diff 35658.5.diff] that adds a `WP_Object_Type` class to WordPress core. It has a `__toString()` method so it can be used as a string. Using this class makes it easy to add subtype support in a backward compatible way to any functions that currently support a post type or other type. 14 15 A `WP_Object_Type` class can also get rid of duplicate code like the following from the patch because it makes it the responsibility of the `WP_Object_Type` object to police itself: 14 16 15 17 {{{