• Resolved ukbestrong

    (@ukbestrong)


    Hi,

    Is there a way to filter by last updated of a specific UM custom field in the member directory?

    The custom field slug is goal_update_confirmed

    Regards

    Rick

    • This topic was modified 5 months ago by ukbestrong.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @ukbestrong

    Unfortunately, this requires customization on your end with the following filter hook:

    e.g.

    add_filter("um_prepare_user_query_args","um_custom_prepare_user_query_args", 9999 );
    function um_custom_prepare_user_query_args( $args ) {
    	
    	$args['meta_query'][ ] = array(
    			'relation' => 'OR',
    		   	'featured_clause' => array(
    				'key' => 'goal_update_confirmed',
    				'value' => '',
    				'compare' => '!='
    		   	),
    		   	array(
    				"key" => 'goal_update_confirmed',
    				"compare" => "NOT EXISTS"
    		   	)
    	);
    
    	$args['orderby'] = array(
    		'featured_clause' => 'ASC',
    		
    	); 
    
    	return $args;
    }

    Regards,

    Thread Starter ukbestrong

    (@ukbestrong)

    Thanks so much for such a kind and helpful response!

    Does this just go in functions.php?

    Best wishes

    Rick

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @ukbestrong

    I haven’t tested it so you will have to modify the above example to match your goal.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.