| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Helps with creating shortlinks in the plugin. |
| 10 |
*/ |
| 11 |
class WPSEO_Shortlinker { |
| 12 |
|
| 13 |
/** |
| 14 |
* Builds a URL to use in the plugin as shortlink. |
| 15 |
* |
| 16 |
* @param string $url The URL to build upon. |
| 17 |
* |
| 18 |
* @return string The final URL. |
| 19 |
*/ |
| 20 |
public function build_shortlink( $url ) { |
| 21 |
return YoastSEO()->helpers->short_link->build( $url ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Returns a version of the URL with a utm_content with the current version. |
| 26 |
* |
| 27 |
* @param string $url The URL to build upon. |
| 28 |
* |
| 29 |
* @return string The final URL. |
| 30 |
*/ |
| 31 |
public static function get( $url ) { |
| 32 |
return YoastSEO()->helpers->short_link->get( $url ); |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Echoes a version of the URL with a utm_content with the current version. |
| 37 |
* |
| 38 |
* @param string $url The URL to build upon. |
| 39 |
* |
| 40 |
* @return void |
| 41 |
*/ |
| 42 |
public static function show( $url ) { |
| 43 |
YoastSEO()->helpers->short_link->show( $url ); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Gets the shortlink's query params. |
| 48 |
* |
| 49 |
* @return array The shortlink's query params. |
| 50 |
*/ |
| 51 |
public static function get_query_params() { |
| 52 |
return YoastSEO()->helpers->short_link->get_query_params(); |
| 53 |
} |
| 54 |
} |
| 55 |
|