; } /** * {@inheritDoc} */ public function get_label( View $view = null ) { $slug = self::get_slug(); /** * Allows filtering of the labels for the Calendar view labels. * * @since 5.12.0 * * @param string $label The label that will be displayed. * @param Link_Abstract $link_obj The link object the label is for. * @param View $view The current View object. * * @return string $label The label that will be displayed. */ return apply_filters( "tec_views_v2_subscribe_links_{$slug}_label", $this->label, $this, $view ); } /** * {@inheritDoc} */ public function get_single_label( View $view = null ) { $slug = self::get_slug(); /** * Allows filtering of the labels for the Single Event view labels. * * @since 5.12.0 * * @param string $label The label that will be displayed. * @param Link_Abstract $link_obj The link object the label is for. * @param View $view The current View object. * * @return string $label The label that will be displayed. */ return apply_filters( "tec_views_v2_single_subscribe_links_{$slug}_label", $this->single_label, $this, $view ); } /** * Fetches the slug of this particular instance of the Link. * * @since 5.12.0 * * @return string */ public static function get_slug() { return static::$slug; } /** * {@inheritDoc} */ public function set_visibility( bool $visible ) { $this->visible = $visible; } /** * {@inheritDoc} */ public function get_uri( View $view = null ) { // If we're on a Single Event view, let's bypass the canonical function call and logic. if ( is_single() ) { $feed_url = null === $view ? tribe_get_single_ical_link() : $view->get_context()->get( 'single_ical_link', false ); } if ( empty( $feed_url ) && null !== $view ) { $feed_url = $this->get_canonical_ics_feed_url( $view ); } if ( empty( $feed_url ) ) { return ''; } $feed_url = str_replace( [ 'http://', 'https://' ], 'webcal://', $feed_url ); return $feed_url; } /** * Retrieve the iCal Feed URL with current context parameters. * * Both iCal and gCal URIs can be built from the Feed URL which simply * points to a canonical URL that the generator can parse * via `tribe_get_global_query_object` and spew out results in the * ICS format. * * This is exactly what \Tribe__Events__iCal::do_ical_template does * and lets it generate from a less vague and a more context-bound URL * for more granular functionality. This lets us have shortcode support * among other things. * * We strip some of the things that we don't need for subscriptions * like end dates, view types, etc., ignores pagination and always returns * fresh future events. * * The URL generated is also inert to the Permalink and Rewrite Rule settings * in WordPress, so it will work out of the box on any website, even if * the settings are changed or break. * * @param View $view The View we're being called from. * * @return string The iCal Feed URI. */ protected function get_canonical_ics_feed_url( View $view = null ) { if ( null === $view ) { return ''; } $view_url_args = $view->get_url_args(); // Some date magic. if ( isset( $view_url_args['eventDate'] ) ) { // Subscribe from the calendar date (pagination, shortcode calendars, etc). $view_url_args['tribe-bar-date'] = $view_url_args['eventDate']; } // Clean query params to only contain canonical arguments. $canonical_args = [ 'post_type', 'tribe-bar-date', 'tribe_events_cat', 'post_tag' ]; /** * Allows other plugins to alter what gets passed to the subscribe link. * * @since 5.12.0 * * @param array $canonical_args A list of "passthrough" argument keys. * @param View|null $view The View we're being called from. * * @return array $canonical_args The modified list of "passthrough" argument keys. */ $canonical_args = apply_filters( 'tec_views_v2_subscribe_links_canonical_args', $canonical_args, $view ); // This array will become the args we pass to `add_query_arg()` $passthrough_args = []; foreach ( $view_url_args as $arg => $value ) { if ( in_array( $arg, $canonical_args, true ) ) { $passthrough_args[ $arg ] = $view_url_args[ $arg ]; } } // iCalendarize! $passthrough_args['ical'] = 1; // Allow all views to utilize the list view so they collect the appropriate number of events. // Note: this is only applied to subscription links - the ics direct link downloads what you see on the page! $passthrough_args["eventDisplay"] = \Tribe\Events\Views\V2\Views\List_View::get_view_slug(); // Tidy (remove empty-value pairs). $passthrough_args = array_filter( $passthrough_args ); /** * Allows other plugins to alter the query args that get passed to the subscribe link. * * @since 5.12.0 * * @param array $passthrough_args The arguments used to build the ical links. * @param array $canonical_args A list of allowed argument keys. * @param View $view The View we're being called from. * * @return array $passthrough_args The modified list of arguments used to build the ical links. */ $passthrough_args = apply_filters( 'tec_views_v2_subscribe_links_url_args', $passthrough_args, $view ); return add_query_arg( urlencode_deep( $passthrough_args ), home_url( '/' ) ); } }
Fatal error: Uncaught Error: Class "Tribe\Events\Views\V2\iCalendar\Links\Link_Abstract" not found in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/iCalendar/Links/Google_Calendar.php:25 Stack trace: #0 /htdocs/wp-content/plugins/intergeo-maps/vendor/composer/ClassLoader.php(412): include() #1 /htdocs/wp-content/plugins/intergeo-maps/vendor/composer/ClassLoader.php(301): Composer\Autoload\includeFile('/htdocs/wp-cont...') #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Tribe\\Events\\Vi...') #3 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Builders/Factory.php(69): class_exists('Tribe\\Events\\Vi...') #4 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(161): TEC\Common\lucatume\DI52\Builders\Factory->getBuilder('Tribe\\Events\\Vi...', 'Tribe\\Events\\Vi...', NULL) #5 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/iCalendar/iCalendar_Handler.php(69): TEC\Common\lucatume\DI52\Container->singleton('Tribe\\Events\\Vi...', 'Tribe\\Events\\Vi...') #6 /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() #7 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe\\Events\\Vi...') #8 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Service_Provider.php(53): TEC\Common\Contracts\Container->register('Tribe\\Events\\Vi...') #9 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(463): Tribe\Events\Views\V2\Service_Provider->register() #10 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe\\Events\\Vi...') #11 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(305): TEC\Common\Contracts\Container->register('Tribe\\Events\\Vi...') #12 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(655): tribe_register_provider('Tribe\\Events\\Vi...') #13 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Main.php(528): Tribe__Events__Main->bind_implementations() #14 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Events__Main->bootstrap('') #15 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #16 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #17 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(128): do_action('tribe_common_lo...') #18 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Main->plugins_loaded('') #19 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #20 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #21 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #22 /htdocs/wp-config.php(92): require_once('/htdocs/wp-sett...') #23 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #24 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #25 /htdocs/index.php(17): require('/htdocs/wp-blog...') #26 {main} thrown in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/iCalendar/Links/Google_Calendar.php on line 25