Custom attachment types
|Reported by:||jfarthing84||Owned by:|
I am testing using custom post types as custom attachment types and it seems that the only blockade is the function wp_get_attachment_url(). Here is why:
if ( 'attachment' != $post->post_type || empty($url) ) return false;
So, my proposal is to either allow a filter to supply valid attachment types instead of checking against 'attachment' or (the better method) use the 'inherit_type' argument from within the register_post_type function and check for an 'inherit_type' of 'attachment'.
I will attach my implementation of both methods, and the developers can choose which one to use.
The only other problem is that many parts of the query have 'attachment' hardcoded in, but, you can get around this with filters. However, my proposal introduces a simple solution to have this fully built-in (check for inherit_type of 'attachment').
Change History (14)
- Keywords changed from developer-feedback, has-patch to developer-feedback has-patch
- Milestone changed from Unassigned to 3.0
comment:6 @jfarthing84 — 5 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
comment:10 @jfarthing84 — 5 years ago
- Resolution set to invalid
- Status changed from reopened to closed