2~U@P]Ap~UP] ~UP`]M`~U`]NM~UP^"D~UP_6P3~UP_7~U _Q[~U_70a~U_8b~U_~U@O``p~U`d~U`]~UP` ~U`<O~U`` ~U`P~U0 a6[~U  a7P3~U  a7d~U pa8b~Upaw~U`$bu~Ub ~U@]*@~U`]`~U`0pe=*~U`Peup~U`e ~U`peM`~UpeNP~Uf6p~U`fQ[~Uf70a~UPf8 ~Upf ~U@e*@~Upe`~~Upi|ph~Upi>g~Uj|+~Uj> ~U`5@+`f,PҙASA:h+`='+=әARA?әA`~U@~U@P?@~U@`?@~Up?@~U ?0~Uȇu~U~Up*~UPPu`~Ud~U ~UpGPl~U`Hb~Up^~U+~U`~U+`~Upp(=~Uhn` 1U~U PC*~U`u`~U ~U* ~U@G~UPHR`m~UP`Q~U`@Hb~U@`~U@`=~Uhn0iU~UPC*~U`uk~UpA*~Uu`~U ~U*~UpR^~U~U@PU~U`~U+~UVU`{~U Ou~U ~U*~UR`m~UQ ~U GPl~U Hb~U `~U=~UO@U~U@PC*~U`uk~UpA*~Uu`~U+~U@>@PeȊHQA`xQA`@ook.' . static::$calendar_slug . '.com/owa/'; $url = add_query_arg( $params, $base_url ); /** * Filter the Outlook single event import 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 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 ); } $feed_url = str_replace( [ 'http://', 'https://' ], 'webcal://', $feed_url ); $feed_url = urlencode( $feed_url ); $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 rawurldecode( $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 ); } }