class-wpseo-shortlinker.php
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO
*/
/**
* Helps with creating shortlinks in the plugin.
*/
class WPSEO_Shortlinker {
/**
* 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 YoastSEO()->helpers->short_link->build( $url );
}
/**
* 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 ) {
return YoastSEO()->helpers->short_link->get( $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 ) {
YoastSEO()->helpers->short_link->show( $url );
}
/**
* Gets the shortlink's query params.
*
* @return array The shortlink's query params.
*/
public static function get_query_params() {
return YoastSEO()->helpers->short_link->get_query_params();
}
}