Hi @media51
I would suggest you to create custom filter using this doc https://www.wp-eventmanager.com/add-custom-field-in-search-filter/
If you want to customize shortcode then you need to understand the shortcode process.
add this filter to apply custom value to shortcode field
event_manager_output_events_defaults
Thank you
is this OK ?
add_filter( 'event_manager_output_events_defaults', 'display_by_departement', 10, 2 );
function display_by_departement( $query_args, $atts ) {
$atts = shortcode_atts(
array(
'departement' => '',
), $atts);
$departement = $atts['departement'];
if ( ! empty( $departement ) {
$query_args['meta_query'][] = array(
'key' => '_departement',
'value' => $departement,
);
}
return $query_args;
}
Hi @media51 ,
no you can’t directly add value and meta_query in above filter. event_manager_output_events_defaults
This is just for adding default value in shortcode.
I think you need to understand this properly. Please follow this doc https://www.wp-eventmanager.com/add-custom-field-in-search-filter/
Thank you