mage-eventpress/inc/template-prts/organizer.php

39 lines
1.1 KiB
PHP
Raw Normal View History

2020-07-12 06:42:13 -04:00
<?php
2020-05-24 04:17:41 -04:00
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
2020-07-12 06:42:13 -04:00
add_action('mep_event_organizer', 'mep_ev_org');
2020-05-24 04:17:41 -04:00
if (!function_exists('mep_ev_org')) {
2023-07-24 22:16:45 -04:00
function mep_ev_org($event_id)
2020-07-12 06:42:13 -04:00
{
global $post, $author_terms;
ob_start();
2023-08-07 01:37:33 -04:00
$org = get_the_terms($event_id, 'mep_org');
if(!empty($org)){
2020-07-12 06:42:13 -04:00
require(mep_template_file_path('single/organizer.php'));
2023-08-07 01:37:33 -04:00
}
2020-07-12 06:42:13 -04:00
$content = ob_get_clean();
2023-07-24 22:16:45 -04:00
echo apply_filters('mage_event_single_org_name', $content, $event_id);
}
}
add_action('mep_event_organizer_name', 'mep_ev_org_name');
if (!function_exists('mep_ev_org_name')) {
function mep_ev_org_name()
{
global $post, $author_terms;
ob_start();
$org = get_the_terms(get_the_id(), 'mep_org');
$names = [];
if(sizeof($org) > 0){
foreach ($org as $key => $value) {
$names[] = $value->name;
}
}
echo esc_html(join($names,', '));
$content = ob_get_clean();
2020-07-12 06:42:13 -04:00
echo apply_filters('mage_event_single_org_name', $content, $post->ID);
}
2022-02-16 22:29:12 -05:00
}