• Resolved nations112

    (@nations112)


    Hi,

    1. After update to PHP 8.1 calendar shows error:
      Warning: Undefined array key “holidays” in /wp-content/plugins/xo-event-calendar/inc/event-calendar-widget.php?on line?235
    2. I need a function in ACF
      – if the URL is filled in = redirect to the given url
      – If the URL empty, use original calendar URL

      Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author ishitaka

    (@ishitaka)

    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?

    Thread Starter nations112

    (@nations112)

    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 1 year, 3 months ago by nations112.
    • This reply was modified 1 year, 3 months ago by nations112.
    Plugin Author ishitaka

    (@ishitaka)

    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.

    Thread Starter nations112

    (@nations112)

    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 1 year, 3 months ago by nations112.
    Plugin Author ishitaka

    (@ishitaka)

    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 );
    }
    
    Thread Starter nations112

    (@nations112)

    This is exactly what we need! Thanks very much!

    Is possible to turn off the URL completely if, for example, we write “-“?

    Plugin Author ishitaka

    (@ishitaka)

    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 );
    }
    
    Plugin Author ishitaka

    (@ishitaka)

    Released version 3.2.3 to fix an error message displayed in the event calendar widget. Please try.

    Thread Starter nations112

    (@nations112)

    Hi,

    It works well. Thanks very much again!

    As a thank you I completely translated the plugin into Czech yesterday.

    Plugin Author ishitaka

    (@ishitaka)

    I’m glad it worked out.

    As a thank you I completely translated the plugin into Czech yesterday.

    Děkuji ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP 8.1 problem + ACF’ is closed to new replies.