de( $event_details ); if ( Tribe__Timezones::is_mode( Tribe__Timezones::SITE_TIMEZONE ) ) { $ctz = Tribe__Timezones::build_timezone_object()->getName(); } else { $ctz = Tribe__Events__Timezones::get_event_timezone_string( $event->ID ); } $pieces = [ 'action' => 'TEMPLATE', 'dates' => $event->dates->start->format( 'Ymd\THis' ) . '/' . $event->dates->end->format( 'Ymd\THis' ), 'text' => rawurlencode( get_the_title( $event ) ), 'details' => $event_details, 'location' => self::generate_string_address( $event ), 'trp' => 'false', 'ctz' => $ctz, 'sprop' => 'website:' . home_url(), ]; /** * Allow users to Filter our Google Calendar Link params * * @deprecated 5.14.0 Moved generic hook to something more specific and appropriate. * * @var array Params used in the add_query_arg * @var int Event ID */ $pieces = apply_filters_deprecated( 'tribe_google_calendar_parameters', [ $pieces, $event->ID ], '5.14.0', 'tec_views_v2_single_event_gcal_link_parameters', 'Moved generic hook to something more specific and appropriate while moving function.' ); /** * Allow users to Filter our Google Calendar Link params before constructing the URL. * After this filter, the list will be trimmed to remove any empty values and discarded if any required params are missing. * * @since 5.14.0 * * @var array $pieces The params used in the add_query_arg. * @var WP_Post $event The Event the link is for. As decorated by tribe_get_event(). */ $pieces = apply_filters( 'tec_views_v2_single_event_gcal_link_parameters', $pieces, $event ); $pieces = array_filter( $pieces ); // Missing required info - bail. if ( empty( $pieces['action'] ) || empty( $pieces['dates'] ) || empty( $pieces['text'] ) ) { return ''; } $url = add_query_arg( $pieces, $base_url ); /** * Allow users to Filter our Google Calendar Link URL - after all params have been applied to the URL. * * @since 5.14.0 * * @var array $url The url to use. * @var WP_Post $event The Event the link is for. As decorated by tribe_get_event(). */ return apply_filters( 'tec_views_v2_single_gcal_subscribe_link', $url, $event ); } /** * Truncate Event Description and add permalink if greater than $length characters. * * @since 5.14.0 * * @param string $event_details The event description. * @param WP_Post|int $post The event post or ID. * @param int $length The max length for the description before adding a "read more" link. * * @return string The possibly modified event description. */ public function format_event_details_for_url( $event_details, $post, int $length = 0 ) { // Hack: Add space after paragraph // Normally Google Cal understands the newline character %0a // And that character will automatically replace newlines on urlencode(). $event_details = str_replace( '

', '

', $event_details ); if ( strlen( $event_details ) <= 996 ) { return $event_details; } $event_details = substr( $event_details, 0, 996 ); $event_details = force_balance_tags( $event_details ); // Ensure we don't have any unclosed tags. $event_url = get_permalink( $post ); // Only add the permalink if it's shorter than 900 characters, so we don't exceed the browser's URL limits. if ( strlen( $event_url ) > 900 ) { return $event_details; } // Append the "read more" link. $event_details .= sprintf( /* Translators: %1$s: Event singular label. %2$s: Event URL. */ esc_html_x( ' (View Full %1$s Description Here: %2$s)', 'Link to full description. %1$s: pre=translated event term. %2$s: event url.', 'the-events-calendar' ), tribe_get_event_label_singular_lowercase(), $event_url ); return $event_details; } /** * Returns a string version of the full address of an event. * * @since 5.14.0 * * @todo This should really live in Tribe__Events__Venue, so move it there at some point * @see Tribe__Events__Main->fullAddressString() * * @param int|WP_Post|null $event The post object or post id. * * @return string The event venue's address. Empty string if the event or venue isn't found. */ public static function generate_string_address( $event = null ) { if ( empty( $event ) ) { $event = get_the_ID(); } $event = tribe_get_event( $event ); // Not an event? Bail. if ( ! tribe_is_event( $event ) ) { return ''; } if ( ! tribe_has_venue( $event ) ) { return ''; } // The below includes the venue name. return \Tribe__Events__Venue::get_address_full_string( $event ); } }
Fatal error: Uncaught Error: Call to a member function hook() on string in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/iCalendar/iCalendar_Handler.php:71 Stack trace: #0 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(463): Tribe\Events\Views\V2\iCalendar\iCalendar_Handler->register() #1 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe\\Events\\Vi...') #2 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Service_Provider.php(53): TEC\Common\Contracts\Container->register('Tribe\\Events\\Vi...') #3 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(463): Tribe\Events\Views\V2\Service_Provider->register() #4 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe\\Events\\Vi...') #5 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(305): TEC\Common\Contracts\Container->register('Tribe\\Events\\Vi...') #6 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(655): tribe_register_provider('Tribe\\Events\\Vi...') #7 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(528): Tribe__Events__Main->bind_implementations() #8 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Events__Main->bootstrap('') #9 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #10 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #11 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(127): do_action('tribe_common_lo...') #12 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Main->plugins_loaded('') #13 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(Object(Sydney_Toolbox), Array) #14 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #15 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #16 /htdocs/wp-config.php(100): require_once('/htdocs/wp-sett...') #17 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #18 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #19 /htdocs/index.php(17): require('/htdocs/wp-blog...') #20 {main} thrown in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/iCalendar/iCalendar_Handler.php on line 71