version = $version; } /** * Builds a URL to use in the plugin as shortlink. * * @param string $url The URL to build upon. * * @return string The final URL. */ public function build_shortlink( $url ) { return $url . '?utm_content=' . $this->version; } /** * Returns a version of the URL with a utm_content with the current version. * * @param string $url The URL to build upon. * * @return string The final URL. */ public static function get( $url ) { $version = WPSEO_VERSION; $version = apply_filters( 'wpseo_shortlink_version', $version ); $shortlinker = new WPSEO_Shortlinker( $version ); return $shortlinker->build_shortlink( $url ); } /** * Echoes a version of the URL with a utm_content with the current version. * * @param string $url The URL to build upon. */ public static function show( $url ) { echo esc_url( self::get( $url ) ); } }