• Resolved Bart Van Belle

    (@bartvanbelle)


    is it possible to add the league to the title of an event in the ical feed?

    could be handy if you follow more than one team through ical

Viewing 7 replies - 1 through 7 (of 7 total)
  • Roch

    (@rochesterj)

    Hi Bart!

    That’s a great idea. I’m not sure if that’s easily doable though. @savvasha, do you know how hard would it be in terms of implementation?

    Thanks!

    Plugin Contributor Savvas

    (@savvasha)

    Currently is not possible. I will add a filter hook to the event title so as you can alter it as you like.

    Thanks,
    Savvas

    Plugin Contributor Savvas

    (@savvasha)

    Hi @bartvanbelle ,

    Please give a look at the following commit. https://github.com/ThemeBoy/SportsPress/commit/0e1b2b9494b93a1bf7422a10eeedafcc00d9b9bb
    Implement the patch at your site and use the following code in your theme’s function.php

    
    function test_filter_hook ( $summary, $event ) {
    	$leagues = wp_get_post_terms( $event->ID, 'sp_league', array( 'fields' => 'names' ) );
    	
    	$summary .= ' ( ' . implode( ",", $leagues ) . ' )';
    	
    	return $summary;
    }
    
    add_filter( 'sportspress_ical_feed_summary', 'test_filter_hook', 99, 2 );
    

    Please give back some feedback.

    Thanks,
    Savvas

    Thread Starter Bart Van Belle

    (@bartvanbelle)

    works fine!

    can the league name be added in the front of the event title in the format [LEAGUE]

    Plugin Contributor Savvas

    (@savvasha)

    Just change
    FROM:
    $summary .= ' ( ' . implode( ",", $leagues ) . ' )';
    TO:
    $summary = ' [ ' . implode( ",", $leagues ) . ' ] ' . $summary;

    Thanks,
    Savvas

    Thread Starter Bart Van Belle

    (@bartvanbelle)

    great!

    thx a lot!

    Plugin Contributor Savvas

    (@savvasha)

    You are welcomed ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘show league in event name in ical calendar’ is closed to new replies.