Hi,
1.
I have confirmed this issue. We plan to fix it in the next version.
2.
I don’t understand what the problem is. Could you please be more specific?
Hi,
Do you know, when the new version will release?
ACF
The link in the calendar normally goes to /akce/name_of_event
(it define( ‘XO_EVENT_CALENDAR_EVENT_POST_TYPE’, ‘akce’ );
We create in ACF custom field URL and we want custom URL if it is filled.
example redirrect to /news/name_of_post with WP post.
if not filled, then normally /akce/name_of_event
And if it will be filled “-“, URL will be disabled for this post (no URL action in calendar widget)
Is it possible?
And last question. Can we change a color of every event in ACF?
Example: category has blue color, in ACF will be yellow, so event will be yellow.
-
This reply was modified 2 years, 9 months ago by
nations112.
-
This reply was modified 2 years, 9 months ago by
nations112.
A fix will be released in a day or two.
Does ACF mean ACF Plugin? Unfortunately, this plugin does not have the ability to work with ACF.
Custom ACF URL works with these function correctly.
function my_xo_event_calendar_events( $events, $args, $month_index ) { foreach( $events as &$event) { $url = get_field( 'リンク', $event['post']->ID ); $event['permalink'] = esc_url( $url ); } return $events; } if ( function_exists( 'get_field' ) ) { add_filter( 'xo_event_calendar_events', 'my_xo_event_calendar_events', 10, 3 ); }
We just need a condition that if it is not filled in, will be used the original URL of event or the link in calendar will be deactivated. Dou you know any solution?
-
This reply was modified 2 years, 9 months ago by
nations112.
Is it like this?
$url = get_field( 'リンク', $event['post']->ID );
$event['permalink'] = esc_url( $url );
↓
$url = get_field( 'リンク', $event['post']->ID );
if ( $url ) {
$event['permalink'] = esc_url( $url );
}
This is exactly what we need! Thanks very much!
Is possible to turn off the URL completely if, for example, we write “-“?
Is it like this?
function my_xo_event_calendar_event_title( $html, $event ) {
$url = get_field( 'リンク', $event['post']->ID );
if ( ! $url ) {
$url = $event['permalink'];
}
$title = ( $event['short_title'] ) ? $event['short_title'] : $event['title'];
$html = '<span class="month-event-title" style="color:#333; background-color:' . esc_attr( $event['bg_color'] ) . ';">' . $title . '</span>';
if ( '-' !== $url ) {
$html = '<a href="' . esc_url( $url ) . '" title="' . esc_attr( $event['title'] ) . '">' . $html . '</a>';
}
return $html;
}
if ( function_exists( 'get_field' ) ) {
add_filter( 'xo_event_calendar_event_title', 'my_xo_event_calendar_event_title', 10, 2 );
}
Released version 3.2.3 to fix an error message displayed in the event calendar widget. Please try.
Hi,
It works well. Thanks very much again!
As a thank you I completely translated the plugin into Czech yesterday.