phpdoc-parser
phpdoc-parser copied to clipboard
Only store a single post for each hook
At present we store an entry for a hook each time it appears in the source. But hooks are only documented once, with duplicate entries marked with a comment. We should ideally only store a single entry for each hook. The entry would then have metadata/something storing the specific data for each place the hook is used (file/function/method and line numbers).
The main issue is that right now post associations are done in a parent/child manner. Since a post can only have one parent, this will have to change. Posts 2 posts has been mentioned before.
Related: #42, #43
I'm new to posts 2 posts, but it looks like it would be a good solution to this. Post associations could also be used for #79. Any thoughts on adding that as a dependency, or alternative approaches that might be better?
The problem with Posts to Posts is that's it's kind of a heavy-handed solution just for this. Might be better off just doing a poor-man's post relationship with a taxonomy mirroring a CPT.
If we need anything at all that doesn't work with basic WP inheritance (parent/child) we are looking into Posts2Posts (I would say "relationships libraries" but there aren't... many of them).
I am not making this into decision and my brain is stretched too thin right now, but I consider relationships definitely on the table as option.