Support » Plugin: Events Manager » [Plugin: Events Manager] Dropdown list for Region field in Add New entry

  • rontarson

    (@rontarson)


    I would like to change the input on the entry page from text to a dropdown to limit regions to a set list. Basically duplicating what is on the search template for regions. This is below from events-search.php

    <!-- START Region Search -->
    		<select name="region" class="em-events-search-region">
    			<option value=''><?php _e('All Regions','dbem'); ?></option>
    			<?php
    			if( !empty($country) ){
    				//get the counties from locations table
    				global $wpdb;
    				$em_states = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT location_region FROM ".EM_LOCATIONS_TABLE." WHERE location_region IS NOT NULL AND location_region != '' AND location_country=%s", $country), ARRAY_N);
    				foreach($em_states as $state){
    					?>
    					 <option <?php echo ($_REQUEST['region'] == $state[0]) ? 'selected="selected"':''; ?>><?php echo $state[0]; ?></option>
    					<?php
    				}
    			}
    			?>
    		</select>
    		<!-- END Region Search -->

    Obviously not as easy to just copy and past this over into em-event.php but is region data conditional to country data as it appears to be in the search field? Maybe im just confused by the use of $states and location_country referenced. I should be able to echo just location_region correct?

    http://wordpress.org/extend/plugins/events-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Events Manager] Dropdown list for Region field in Add New entry’ is closed to new replies.