Hi Jason,
You can, but not as easily as simply editing the templates. The query for events, and the mark-up for the filter/search input is all done in the shortcode handler (see includes/shortcodes.php
). But you can replace that handler with the following:
add_shortcode( 'event_search' , 'my_replacement_handler' );
function my_replacement_handler(){
//Define you're replacement handler
}
Note: the file in which you use that code must be included after the original handler is declared (its a case of ‘last one wins’). functions.php
should be fine. If its in a plug-in you’ll probably want to include the above on plugins_loaded
or init
hook.
The original handler is _eventorganiser_event_search_shortcode_handler()
, so you’ll want to copy and modify the contents of that function.
At the top is the following:
$input = isset( $_REQUEST['eo_search'] ) ? $_REQUEST['eo_search'] : array();
If $input
is empty you could just set the appropriate arguments to the default query. To give you an idea of what $input
should look like:
$input = array(
's' => '',//search term
'event-category' => '',//event category slug
'event-venue' => '',//event venue slug
'event-venue' => '',//event venue slug
'venue_query' => array(
array(
'key' =>'_city'
'value' => '', //venue city
),
array(
'key' =>'_state'
'value' => '', //venue state
),
array(
'key' =>'_country'
'value' => '', //venue country
),
),
'event_start_after' => '',//date / relative date
'event_start_before' => '',//date / relative date
);
(Although you could just edit the plug-in files, I don’t recommend this: when you update your changes will be lost).