Skip to content

Instantly share code, notes, and snippets.

View xymox12's full-sized avatar

euanjfc xymox12

View GitHub Profile
@xymox12
xymox12 / gist:4718315
Last active December 12, 2015 04:58
Events Manager - Search/filter but custom attribute (field) v.03
add_action('em_template_events_search_form_ddm', 'my_em_styles_search_form');
function my_em_styles_search_form(){
$custom_attrs = get_meta_values('Hosted_by','Event');
?>
<!-- START Styles Search -->
<select name="host">
<option value=''>All Styles</option>
<?php foreach($custom_attrs as $meta_name): ?>
<option value="<?php echo $meta_name; ?>" <?php echo ($_GET['host'] == $meta_name) ? 'selected="selected"':''; ?>><?php echo $meta_name; ?></option>
<?php endforeach; ?>
@xymox12
xymox12 / gist:4718304
Last active December 13, 2016 23:27
Events manager - custom taxonomy and search filter
<?php
// custom host taxonomy for events
add_action( 'init', 'register_my_taxonomies', 0 );
function register_my_taxonomies() {
$labels = array(
'name' => 'Hosts',
'singular_name' => 'Host',
'search_items' => 'Search hosts',
'popular_items' => 'Popular hosts',