poti
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Plugins
In reply to: [The Events Calendar] Polylang & Events CalendarI change this function in
\wp-content\plugins\unyson\framework\extensions\events\extensions\events-tags\class-fw-extension-events-tags.php
Its works for merivate function _fw_prepare_data( $items, $format = null ) { $result = array(); foreach ( $items as $key => $item ) { //start datetime { $timestamp_start_date = get_post_meta( $item->ID, $this->from_date, true ); $timestamp_start_time = get_post_meta( $item->ID, $this->from_time, true ); $result[ $item->post_parent ][ $key ]['start'] = ( $timestamp_start_date + $timestamp_start_time ); } //end datetime { $timestamp_end_date = get_post_meta( $item->ID, $this->to_date, true ); $timestamp_end_time = ( strtolower( get_post_meta( $item->ID, $this->all_day, true ) ) === 'yes' ? 86399 : get_post_meta( $item->ID, $this->to_time, true ) ); // 23:59:59 86399 //86400 24:00:00 $result[ $item->post_parent ][ $key ]['end'] = ( $timestamp_end_date + $timestamp_end_time ); } } $result = $this->_fw_grouped_calendar_dates( $result, $format ); $return_value = array(); $i = 0; //fill return value with shrortcode Calendar supported data structure foreach ( $result as $event_id => $intervals ) { if ( is_null( get_post( $event_id ) ) ) { continue; } if (function_exists('pll_current_language')) { if (pll_get_post_language($event_id) !== pll_current_language()) continue; } $title = get_the_title( $event_id ); $url = get_permalink( $event_id ); foreach ( $intervals as $interval ) { $return_value[ $i ]['start'] = $interval['start']; $return_value[ $i ]['end'] = $interval['end']; $return_value[ $i ]['id'] = $event_id; $return_value[ $i ]['title'] = htmlspecialchars_decode( $title ); $return_value[ $i ]['url'] = $url; $i ++; } } return $return_value; }
Viewing 1 replies (of 1 total)