mage-eventpress/templates/template-prts/event_location.php

177 lines
7.3 KiB
PHP
Raw Normal View History

2018-07-02 05:44:24 -04:00
<?php
add_action('mep_event_location','mep_ev_location');
2019-01-31 06:55:36 -05:00
add_action('mep_event_location_ticket','mep_ev_location_ticket');
2019-02-18 23:30:58 -05:00
function mep_ev_location_cart($event_id,$event_meta){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo get_term_meta( $org_id, 'org_location', true ); ?>,<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_state', true )){ echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
}else{
?>
<?php echo $event_meta['mep_location_venue'][0]; ?>, <?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>, <?php } if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>, <?php } if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>, <?php } if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>, <?php } if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
}
}
2019-01-31 06:55:36 -05:00
function mep_ev_location_ticket($event_id,$event_meta){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
?>
2019-02-18 23:30:58 -05:00
<?php echo get_term_meta( $org_id, 'org_location', true ); ?>,
2019-01-31 06:55:36 -05:00
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <?php echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
}else{
?>
<?php echo $event_meta['mep_location_venue'][0]; ?>,
<?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>, <?php } ?>
<?php if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>, <?php } ?>
<?php if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>, <?php } ?>
<?php if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>, <?php } ?>
<?php if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
}
}
2018-07-02 05:44:24 -04:00
function mep_ev_location(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
2018-07-02 05:44:24 -04:00
?>
2019-01-23 05:43:47 -05:00
<p><?php echo get_term_meta( $org_id, 'org_location', true ); ?>,</p>
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><p><?php echo get_term_meta( $org_id, 'org_street', true ); ?>,</p> <?php } ?>
2019-01-24 04:27:59 -05:00
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_city', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_state', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_country', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_country', true ); ?></p> <?php }
2019-01-23 05:43:47 -05:00
}else{
?>
<p><?php echo $event_meta['mep_location_venue'][0]; ?>,</p>
<?php if($event_meta['mep_street'][0]){ ?><p><?php echo $event_meta['mep_street'][0]; ?>,</p> <?php } ?>
<?php if($event_meta['mep_city'][0]){ ?> <p><?php echo $event_meta['mep_city'][0]; ?>,</p> <?php } ?>
<?php if($event_meta['mep_state'][0]){ ?> <p><?php echo $event_meta['mep_state'][0]; ?>,</p> <?php } ?>
<?php if($event_meta['mep_postcode'][0]){ ?> <p><?php echo $event_meta['mep_postcode'][0]; ?>,</p> <?php } ?>
<?php if($event_meta['mep_country'][0]){ ?> <p><?php echo $event_meta['mep_country'][0]; ?></p> <?php }
}
2018-07-02 05:44:24 -04:00
}
add_action('mep_event_location_venue','mep_ev_venue');
function mep_ev_venue(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_location', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_location_venue'][0]; ?></span>
<?php
}
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
add_action('mep_event_location_street','mep_ev_street');
function mep_ev_street(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_street', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_street'][0]; ?></span>
<?php
}
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
add_action('mep_event_location_city','mep_ev_city');
function mep_ev_city(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_city', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_city'][0]; ?></span>
<?php
}
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
add_action('mep_event_location_state','mep_ev_state');
function mep_ev_state(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_state', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_state'][0]; ?></span>
<?php
}
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
add_action('mep_event_location_postcode','mep_ev_postcode');
function mep_ev_postcode(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_postcode', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_postcode'][0]; ?></span>
<?php
}
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
add_action('mep_event_location_country','mep_ev_country');
function mep_ev_country(){
2019-01-23 05:43:47 -05:00
global $post,$event_meta;
$location_sts = get_post_meta($post->ID,'mep_org_address',true);
if($location_sts){
$org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo "<span>".get_term_meta( $org_id, 'org_country', true )."</span>";
}else{
2018-07-02 05:44:24 -04:00
?>
<span><?php echo $event_meta['mep_country'][0]; ?></span>
<?php
2019-01-23 05:43:47 -05:00
}
2018-07-02 05:44:24 -04:00
}