brandonwamboldt / wp-orm

[Unmaintained] Light weight ORM for WordPress
MIT License
176 stars 35 forks source link

Perform a Query by Custom Fields #8

Closed miguelrs closed 10 years ago

miguelrs commented 10 years ago

I've just found this plugin and it looks really interesting, but it's not clear for me how to query Posts by some Custom Fields values.

For example, let's say I have a Custom Post Type "Exhibition" and I added 2 custom fields "start_datetime" and "end_datetime" (I added those using Advanced Custom Fields if that matters)

So, as an example, can you tell roughly how would look the query to get all the current Exhibitions? (i.e., Exhibitions with "start_datetime" < now and "end_datetime" > now)

jfern01 commented 10 years ago

As far as I can tell, you can't query Posts/Pages by their metadata with wp-orm.

miguelrs commented 10 years ago

Ok, thanks @jfern01. In that case, although the plugin is still cool, it's much less interesting than I was thinking... :-1:

jfern01 commented 10 years ago

This being open source and all, you could, you know... request the feature. Or even better, come up with an implementation yourself and make a pull request.

miguelrs commented 10 years ago

Sure! I'll take a look at give it a try if I think I can contribute, because the idea of the plugin is really smart...