Forums Forums Search & Filter Pro Post Meta “Time” and ACF “Datetime”

Tagged: 

Viewing 10 posts - 1 through 10 (of 11 total)
  • Anonymous
    #266545

    Hello,

    I wanted to know if the Post Meta – Date field was compatible with the ACF Datetime field?
    I set the “Date Input Format” option to YYYYMMDD (ACF) but it doesn’t work.

    If not, am I forced to split the date and the time?

    I would like to avoid for my meta_query in “sf_edit_query_args” function:

    function filter_function_name( $query_args, $sfid ) {
    	if( $sfid == 73 ) {
    		$now = current_time('Y-m-d H:i:s');
    
    		$query_args['meta_query'] = array(
    			array(
    				'key'		=> 'live_datetime',
    				'value'		=> $now,
    				'compare'	=> '>',
    				'type'		=> 'DATETIME',
    			)
    		);
    	}
    
    	return $query_args;
    }
    add_filter('sf_edit_query_args', 'filter_function_name', 20, 2);

    Thanks in advance!

    Trevor
    #266615

    What is it you need to do, or are trying to achieve?

    Outside of the filter you mention, our UI settings do not support datetime fields for filtering, so you may need to use that function.

    Anonymous
    #266880

    Hi Trevor,

    With your plugin, I want to filter items with a “Post Meta – Date” field.
    But the data comes from an ACF Datetime field.

    I imagine that is not possible?

    Trevor
    #266882

    It is likely it would not, correct. Best to try it first though.

    Anonymous
    #266884

    I had tested and it does not work.
    I imagine it will be good for V3! 🙂

    Trevor
    #266886

    I hope so. Is it OK to close this thread for now?

    Anonymous
    #266890

    Yes!
    Thank you.

    Anonymous
    #266892
    This reply has been marked as private.
    Trevor
    #266894
    This reply has been marked as private.
    Anonymous
    #266896
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 11 total)