Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Get List of Venues and their ID's | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Get List of Venues and their ID's

Get List of Venues and their ID's

Posted: August 21, 2013 at 4:59 pm

Viewing 3 reply threads


Deborah Walden

August 21, 2013 at 4:59 pm

Is there a quick function available that can get these for me? I want to use this:

<?php echo do_shortcode('[ESPRESSO_VENUE_EVENTS id=1]');?>

but have the id part be a dynamic variable that is passed via a select input element on the same page, then I can load up events based on the location (venue) of their choosing.

Either that, or is this something that you think we should be modifying in the event_list_display.php file.


Dean

  • Support Staff

August 22, 2013 at 12:46 am

Hi Deborah,

There is nothing in built, you would need to run a custom function (I used the Custom Files Addon to do this) to grab the data from the database.

Something like

function get_all_venue_ids() {

global $wpdb;

$table_name = $wpdb->prefix . "events_venue"; 
   
$thevenues = $wpdb->get_col("SELECT id FROM $table_name");

return $thevenues;   
   
}

and then call it in the appropriate template like so

<?php $venue_id_array = get_all_venue_ids(); ?>

Now you have the venue ID’s in an array to do with as you need.


Deborah Walden

August 28, 2013 at 3:03 pm

Dean, this worked out great, I am able to get whatever I need from the db with this. Super convenient.


Dean

  • Support Staff

August 28, 2013 at 11:19 pm

You’re more than welcome!

Viewing 3 reply threads

The support post ‘Get List of Venues and their ID's’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server