Skip to content

Instantly share code, notes, and snippets.

@richaber
Created June 28, 2022 16:50
Show Gist options
  • Save richaber/bb088fa84bd04f8614558722ff8d1d4e to your computer and use it in GitHub Desktop.
Save richaber/bb088fa84bd04f8614558722ff8d1d4e to your computer and use it in GitHub Desktop.
tribe_get_venue_object() example var dump

Shape of WP_Post decorated post object representing a Venue returned by tribe_get_venue_object().

https://docs.theeventscalendar.com/reference/functions/tribe_get_venue_object/

<?php

$tribe_venue = tribe_get_venue_object(get_the_ID());
$tribe_venue = WP_Post::__set_state(
    array(
        'ID'                    => 4947,
        'post_author'           => '1',
        'post_date'             => '2021-12-12 09:47:28',
        'post_date_gmt'         => '2021-12-12 16:47:28',
        'post_content'          => 'This is some content.',
        'post_title'            => 'Alexandria, Minnesota',
        'post_excerpt'          => '',
        'post_status'           => 'publish',
        'comment_status'        => 'closed',
        'ping_status'           => 'closed',
        'post_password'         => '',
        'post_name'             => 'alexandria-minnesota',
        'to_ping'               => '',
        'pinged'                => '',
        'post_modified'         => '2022-06-27 16:18:35',
        'post_modified_gmt'     => '2022-06-27 22:18:35',
        'post_content_filtered' => '',
        'post_parent'           => 0,
        'guid'                  => 'https://site.local/?post_type=tribe_venue&#038;p=4947',
        'menu_order'            => 0,
        'post_type'             => 'tribe_venue',
        'post_mime_type'        => '',
        'comment_count'         => '0',
        'filter'                => 'raw',
        'address'               => '704 Broadway St',
        'country'               => 'United States',
        'city'                  => 'Alexandria',
        'state_province'        => 'MN',
        'state'                 => 'MN',
        'province'              => '',
        'zip'                   => '56308',
        'permalink'             => 'https://site.local/venue/alexandria-minnesota/',
        'directions_link'       => 'https://www.google.com/maps/search/?api=1&#038;query=36.1292938%2C-95.8774964',
        'geolocation'           =>
            (object)array(
                'overwrite_coordinates' => true,
                'latitude'              => '45.8844531',
                'longitude'             => '-95.3782393',
                'address'               => '704 Broadway St Alexandria MN 56308 United States',
                'distance'              => false,
            ),
    )
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment