function update

This commit is contained in:
magepeopleteam 2021-11-01 07:26:30 +00:00
parent ecbbc9b67e
commit 15720d0ceb
4 changed files with 53 additions and 47 deletions

View File

@ -111,4 +111,10 @@ function mep_ajax_url(){
var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
</script>
<?php
}
}
add_action('wp_head', 'mep_add_wp_header_scripts');
function mep_add_wp_header_scripts(){
echo mep_event_rich_text_data();
echo mep_apply_custom_css();
}

View File

@ -1255,8 +1255,7 @@ if (!function_exists('mep_add_to_google_calender_link')) {
.mep-default-sidrbar-social .mep-event-meta {text-align: center;}
</style>
<?php
$content = ob_get_clean();
echo $content;
return ob_get_clean();
}
}
@ -1687,8 +1686,7 @@ if (!function_exists('mep_get_all_date_time')) {
<li><i class="fa fa-calendar"></i> <?php echo date_i18n($date_format, strtotime($end_datetime)); ?> <i class="fa fa-clock-o"></i> <?php echo date($timeformatassettings, strtotime($end_datetime)); ?> <span style='font-size: 12px;font-weight: bold;'>(<?php esc_html_e('End', 'mage-eventpress'); ?>)</span></li>
</ul>
<?php
$content = ob_get_clean();
echo $content;
echo ob_get_clean();
}
}
@ -2697,7 +2695,7 @@ if (!function_exists('get_event_list_js')) {
</script>
<?php
echo $content = ob_get_clean();
echo ob_get_clean();
}
}
@ -2766,10 +2764,16 @@ if (!function_exists('mep_event_get_the_content')) {
}
/**
* This the function which will create the Rich Text Schema For each event into the <head></head> section.
*/
add_action('wp_head', 'mep_event_rich_text_data');
if (!function_exists('mep_event_rich_text_data')) {
function mep_event_rich_text_data() {
global $post;
@ -2791,44 +2795,42 @@ if (!function_exists('mep_event_rich_text_data')) {
?>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "<?php echo esc_attr($event_name); ?>",
"startDate": "<?php echo esc_attr($event_start_date); ?>",
"endDate": "<?php echo esc_attr($event_end_date); ?>",
"organizer": "<?php echo esc_attr($org_name); ?>",
"eventStatus": "https://schema.org/<?php echo esc_attr($event_rt_status); ?>",
"eventAttendanceMode": "https://schema.org/<?php echo esc_attr($event_rt_atdnce_mode); ?>",
"previousStartDate": "<?php echo esc_attr($event_rt_prv_date); ?>",
"location": {
"@type": "Place",
"name": "<?php echo mep_get_event_location($event_id); ?>",
"address": {
"@type": "PostalAddress",
"streetAddress": "<?php echo mep_get_event_location_street($event_id); ?>",
"addressLocality": "<?php echo mep_get_event_location_city($event_id); ?>",
"postalCode": "<?php echo mep_get_event_location_postcode($event_id) ?>",
"addressRegion": "<?php echo mep_get_event_location_state($event_id) ?>",
"addressCountry": "<?php echo mep_get_event_location_country($event_id) ?>"
}
},
"image": [
"<?php echo get_the_post_thumbnail_url($event_id, 'full'); ?>"
],
"description": "<?php echo strip_tags(get_the_excerpt($event_id)); ?>",
"performer": {
"@type": "PerformingGroup",
"name": "<?php echo esc_attr($org_name); ?>"
}
}
{
"@context": "https://schema.org",
"@type": "Event",
"name": "<?php echo esc_attr($event_name); ?>",
"startDate": "<?php echo esc_attr($event_start_date); ?>",
"endDate": "<?php echo esc_attr($event_end_date); ?>",
"organizer": "<?php echo esc_attr($org_name); ?>",
"eventStatus": "https://schema.org/<?php echo esc_attr($event_rt_status); ?>",
"eventAttendanceMode": "https://schema.org/<?php echo esc_attr($event_rt_atdnce_mode); ?>",
"previousStartDate": "<?php echo esc_attr($event_rt_prv_date); ?>",
"location": {
"@type": "Place",
"name": "<?php echo mep_get_event_location($event_id); ?>",
"address": {
"@type": "PostalAddress",
"streetAddress": "<?php echo mep_get_event_location_street($event_id); ?>",
"addressLocality": "<?php echo mep_get_event_location_city($event_id); ?>",
"postalCode": "<?php echo mep_get_event_location_postcode($event_id) ?>",
"addressRegion": "<?php echo mep_get_event_location_state($event_id) ?>",
"addressCountry": "<?php echo mep_get_event_location_country($event_id) ?>"
}
},
"image": [
"<?php echo get_the_post_thumbnail_url($event_id, 'full'); ?>"
],
"description": "<?php echo strip_tags(get_the_excerpt($event_id)); ?>",
"performer": {
"@type": "PerformingGroup",
"name": "<?php echo esc_attr($org_name); ?>"
}
}
</script>
<?php
echo $content = ob_get_clean();
return ob_get_clean();
}
}
}
@ -2910,7 +2912,7 @@ if (!function_exists('mep_custom_css_sectings_fields')) {
return array_merge($default_fields, $settings_fields);
}
}
add_action('wp_head', 'mep_apply_custom_css', 90);
// add_action('wp_head', 'mep_apply_custom_css', 90);
if (!function_exists('mep_apply_custom_css')) {
function mep_apply_custom_css() {
$custom_css = mep_get_option('mep_custom_css', 'mep_settings_custom_css', '');
@ -2921,7 +2923,7 @@ if (!function_exists('mep_apply_custom_css')) {
<?php echo $custom_css; ?>
</style>
<?php
echo ob_get_clean();
return ob_get_clean();
}
}
@ -4375,8 +4377,6 @@ if (!class_exists('MPWEM_Helper')) {
$city_list[] = $post->meta_value;
}
}
//wp_reset_postdata();
//ob_get_clean();
return $city_list;
}

View File

@ -14,7 +14,7 @@ if (!function_exists('mep_ev_calender')) {
* Action Hook mep_before_add_calendar_button & mep_after_add_calendar_button
*/
do_action('mep_before_add_calendar_button');
mep_add_to_google_calender_link($event_id);
echo mep_add_to_google_calender_link($event_id);
do_action('mep_after_add_calendar_button');
?>
</div>

View File

@ -96,7 +96,7 @@ class MEPEventAddCalendarWidget extends Widget_Base {
<div class="calender-url">
<?php
do_action('mep_before_add_calendar_button');
mep_add_to_google_calender_link($event_id);
echo mep_add_to_google_calender_link($event_id);
do_action('mep_after_add_calendar_button');
?>
</div>