List comments by comment meta
-
To give you a real world example of what I mean, I’m wanting to create a page that uses two comment forms, and displays the comments from those two forms in two separate lists. First of all I thought about adding a comment type, but that doesn’t seem to be extendible. So then I thought about comment meta.
We can add comment meta with add_comment_meta, and then get that comment meta for a given comment with get_comment_meta. Given that posts can be retrieved based on custom field meta with query_posts, why can’t comments be retrieved based on their meta keys and values?
I realise this is a limited case scenario, but there must be a way of doing it using WordPress’ built in functions and not running my own sql select query.
I’ve spent a fair while searching, and not found anything. Anyone have any pointers? It seems like a logical step would be to add args to wp_list_comments allowing for
meta_key=
andmeta_value=
. Thoughts?I may have missed something blindingly obvious, of course!
Thanks in advance
- The topic ‘List comments by comment meta’ is closed to new replies.