• Resolved studioleland

    (@studioleland)


    Hey dev,

    I’m using the WP Events Manager plugin for event management. I see this works great on to filter by date except I’d like to filter on a custom field of start_date instead of post date or modified date. Any Suggestions on how to do this and restrict only to Events post type? Thanks very much.

    https://wordpress.org/plugins/date-range-filter/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jonathan Bardo

    (@jonathanbardo)

    Hey,

    I would seriously advise against doing a date comparison with post meta (could be really slow if you have a lot of events). What this plugin really does is to use date_query to filter post and you would have to do some custom manipulation to get to your desired output. It could be done though!

    If I were you, I would extend this plugin with your own implementation of some of the methods. Please take a look at this article: https://jonathanbardo.com/2014/12/extending-a-wordpress-plugin-coded-as-a-class/

    Thread Starter studioleland

    (@studioleland)

    Any chance I could commission you to assist with this task? I believe this would be much more efficient than taking this on myself. I am WP code savvy but it seems your knowledge of this stuff is more advanced. Please advise.

    Plugin Author Jonathan Bardo

    (@jonathanbardo)

    Normally I would be glad to assist you but I honestly have a little too much on my plate at the moment. If you want to take a spin at it I can code review it quickly to help you.

    Hi,

    I can’t even figure out how to filter for post_modified using the filter you posted on the Plugin Page.

    As to the problem mentioned above my approach would be to write the dates into a new column (or even the post modified column) in the wp_posts table for the event post type.

    ak

    (@apkoponen)

    BTW, this should work for the original problem (add to functions.php).

    http://pastebin.com/1HfMYSUZ

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter custom post type for custom field value only’ is closed to new replies.