>w w w pdw w (!w =w <Egw w >w `yw  w  ډw #w 0!w =w N[@w ݉w Šw >w Pzw  `w w 8!w =w cksw ็w !pw >w  w 1w H!w @!w w =w ms 3w Êw >w `?w  pՉw 0#w P!w H#w =w uz؉w @{Aw  }tUl!tUl!tU`56tU`pw @w A`Aw dw w h!w `pw pw w A8Ċw dw w p!w `pw  w w AĊw dw w `w !w x!w `pw ,,%w w AĊw dw w !w `pw 55w w Aۅw dw Ћw !w `pw ;;w w AAw dw w !w `pw CCpw w AHÊw dw w Æw w !w `pw MM׆w Æw A Êw dw @w P0w !w `pw UU@w 0w A!Šw dw w  vw !w !w `pw ^^@&w vw Aw dw w !w `pw ffsw w m string $url The url used to subscribe to a calendar in Outlook. * @param string $base_url The base url used to subscribe in Outlook. * @param array $params An array of parameters added to the base url. * @param Outlook_Methods $this An instance of the link abstract. */ $url = apply_filters( 'tec_events_ical_outlook_single_event_import_url', $url, $base_url, $params, $this ); return $url; } /** * Generate the subscribe URL. * * @since 5.16.0 * * @return string The subscribe url. */ public function generate_outlook_subscribe_url( View $view = null ) { $base_url = 'https://outlook.' . static::$calendar_slug . '.com/owa?path=/calendar/action/compose'; if ( null !== $view ) { $feed_url = $this->get_canonical_ics_feed_url( $view ); } // Remove ical query and add back after urlencoding the rest of the url. $feed_url = remove_query_arg( 'ical', $feed_url ); $feed_url = str_replace( [ 'http://', 'https://' ], 'webcal://', $feed_url ); $feed_url = urlencode( $feed_url ); $feed_url = $feed_url . '&ical=1'; $params = [ 'rru' => 'addsubscription', 'url' => urlencode( $feed_url ), 'name' => urlencode( get_bloginfo( 'name' ) . ' ' . $view->get_title() ), ]; $url = add_query_arg( $params, $base_url ); /** * Filter the Outlook subscribe url. * * @since 5.16.0 * * @param string $url The url used to subscribe to a calendar in Outlook. * @param string $base_url The base url used to subscribe in Outlook. * @param string $feed_url The subscribe url used on the site. * @param array $params An array of parameters added to the base url. * @param Outlook_Abstract_Export $this An instance of the link abstract. */ $url = apply_filters( 'tec_events_ical_outlook_subscribe_url', $url, $base_url, $feed_url, $params, $this ); return $url; } /** * Changing spaces to %20 and encoding. * urlencode() changes the spaces to +. That is also how Outlook will show it. * So we're replacing it temporarily and then changing them to %20 which will work. * * @since 5.16.0 * * @param string $string The URL string. * * @return string The encoded URL string. */ public function space_replace_and_encode( $string ) { $string = str_replace( ' ', static::$outlook_temp_space, $string ); $string = urlencode( $string ); $string = str_replace( static::$outlook_temp_space, static::$outlook_space, $string ); return $string; } /** * {@inheritDoc} */ public function get_uri( View $view = null ) { if ( is_single() ) { return $this->generate_outlook_full_url(); } if ( null === $view ) { return ''; } return $this->generate_outlook_subscribe_url( $view ); } }