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

44 lines
1.6 KiB
PHP
Raw Normal View History

2020-04-28 06:37:33 -04:00
<?php
2020-05-24 04:17:41 -04:00
if (!defined('ABSPATH')) {
die;
} // Cannot access pages directly.
2020-04-28 06:37:33 -04:00
/**
* This Function will hooked up with the speaker action hook mep_event_speakers_list to display the Event Speaker List
*/
2020-07-12 06:42:13 -04:00
add_action('mep_event_speakers_list', 'mep_display_speaker_list');
if (!function_exists('mep_display_speaker_list')) {
function mep_display_speaker_list($event_id)
{
$speakers_id = get_post_meta($event_id, 'mep_event_speakers_list', true) ? maybe_unserialize(get_post_meta($event_id, 'mep_event_speakers_list', true)) : array();
$speaker_icon = get_post_meta($event_id, 'mep_event_speaker_icon', true) ? get_post_meta($event_id, 'mep_event_speaker_icon', true) : 'fa fa-microphone';
2021-10-31 07:01:04 -04:00
$speaker_label = get_post_meta($event_id, 'mep_speaker_title', true) ? get_post_meta($event_id, 'mep_speaker_title', true) : esc_html__("Speaker's", "mage-eventpress");
2020-07-12 06:42:13 -04:00
if (is_array($speakers_id) && sizeof($speakers_id) > 0) {
require(mep_template_file_path('single/speaker-list.php'));
2020-04-28 06:37:33 -04:00
}
}
2020-07-20 06:01:44 -04:00
}
if (!function_exists('mep_display_all_speaker_list')) {
function mep_display_all_speaker_list()
{
$args = array(
'post_type' => array('mep_event_speaker'),
'posts_per_page' => -1
);
$loop = new WP_Query($args);
2021-10-31 07:01:04 -04:00
?>
<ul>
<?php
2020-07-20 06:01:44 -04:00
foreach ($loop->posts as $speaker) {
$speakers = $speaker->ID;
require(mep_template_file_path('all-speaker-list.php'));
}
2021-10-31 07:01:04 -04:00
?>
</ul>
<?php
2020-07-20 06:01:44 -04:00
}
}