Problem: I would like to create a custom search View where Users can filter posts by post modified date using datepicker(s).
Solution: At this time it is not possible to allow Users to filter a View by post date or modified date. It is possible to filter by a custom field date, so the best approach for now is to use custom code to copy the modified date into a custom field on the post.
function copy_modified_date_field( $post_id, $post ){ if ( 'project' == $post->post_type ) { $now = time(); update_post_meta( $post_id, 'wpcf-modified-date', $now ); } } add_action( 'save_post', 'copy_modified_date_field', 20, 2 );
Relevant Documentation:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Our next available supporter will start replying to tickets in about 4.09 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by 6 years, 6 months ago.
Assisted by: Christian Cox.