| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 14 | return; |
| 15 | 15 | } |
| 16 | 16 | // Current SDK version and path. |
| 17 | -$themeisle_sdk_version = '3.2.40'; | |
| 17 | +$themeisle_sdk_version = '3.3.13'; | |
| 18 | 18 | $themeisle_sdk_path = dirname( __FILE__ ); |
| 19 | 19 | |
| 20 | 20 | global $themeisle_sdk_max_version; |
| 21 | 21 | global $themeisle_sdk_max_path; |
| @@ -89,10 +89,10 @@ | ||
| 89 | 89 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : $pagenow; |
| 90 | 90 | $current_page = isset( $screen->id ) ? $screen->id : ( ( $screen === null ) ? 'non-admin' : $screen ); |
| 91 | 91 | $current_page = sanitize_key( str_replace( '.php', '', $current_page ) ); |
| 92 | 92 | } |
| 93 | - $location = $location === null ? $current_page : $location; | |
| 94 | - $content = sanitize_key( | |
| 93 | + $location = $location === null ? $current_page : $location; | |
| 94 | + $content = sanitize_key( | |
| 95 | 95 | trim( |
| 96 | 96 | str_replace( |
| 97 | 97 | [ |
| 98 | 98 | 'https://', |
| @@ -101,24 +101,28 @@ | ||
| 101 | 101 | '/plugins/', |
| 102 | 102 | '/upgrade', |
| 103 | 103 | ], |
| 104 | 104 | '', |
| 105 | - $url | |
| 105 | + $url | |
| 106 | 106 | ), |
| 107 | - '/' | |
| 108 | - ) | |
| 107 | + '/' | |
| 108 | + ) | |
| 109 | 109 | ); |
| 110 | - return esc_url_raw( | |
| 110 | + $filter_key = sanitize_key( $content ); | |
| 111 | + $url_args = [ | |
| 112 | + 'utm_source' => 'wpadmin', | |
| 113 | + 'utm_medium' => $location, | |
| 114 | + 'utm_campaign' => $area, | |
| 115 | + 'utm_content' => $content, | |
| 116 | + ]; | |
| 117 | + $query_arguments = apply_filters( 'tsdk_utmify_' . $filter_key, $url_args, $url ); | |
| 118 | + $utmify_url = esc_url_raw( | |
| 111 | 119 | add_query_arg( |
| 112 | - [ | |
| 113 | - 'utm_source' => 'wpadmin', | |
| 114 | - 'utm_medium' => $location, | |
| 115 | - 'utm_campaign' => $area, | |
| 116 | - 'utm_content' => $content, | |
| 117 | - ], | |
| 118 | - $url | |
| 119 | - ) | |
| 120 | + $query_arguments, | |
| 121 | + $url | |
| 122 | + ) | |
| 120 | 123 | ); |
| 124 | + return apply_filters( 'tsdk_utmify_url_' . $filter_key, $utmify_url, $url ); | |
| 121 | 125 | } |
| 122 | 126 | |
| 123 | 127 | add_filter( 'tsdk_utmify', 'tsdk_utmify', 10, 3 ); |
| 124 | 128 | } |