wpsc_remove_tracking_params_from_uri()
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
wpsc_remove_tracking_params_from_uri( $uri );
- $uri (обязательный)
- -
Код wpsc_remove_tracking_params_from_uri() wpsc remove tracking params from uri WPSCache 1.12.4
function wpsc_remove_tracking_params_from_uri( $uri ) { global $wpsc_tracking_parameters, $wpsc_ignore_tracking_parameters; if ( ! isset( $wpsc_ignore_tracking_parameters ) || ! $wpsc_ignore_tracking_parameters ) { return $uri; } if ( ! isset( $wpsc_tracking_parameters ) || empty( $wpsc_tracking_parameters ) ) { return $uri; } $parsed_url = wpsc_parse_partial_url( $uri ); $query = array(); if ( isset( $parsed_url['query'] ) ) { parse_str( $parsed_url['query'], $query ); foreach ( $wpsc_tracking_parameters as $param_name ) { unset( $query[ $param_name ] ); unset( $_GET[ $param_name ] ); } } $path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : ''; $query = ! empty( $query ) ? '?' . http_build_query( $query ) : ''; if ( empty( $_GET ) ) { $_SERVER['REQUEST_URI'] = strtok( $_SERVER['REQUEST_URI'], '?' ); } if ( $uri !== $path . $query ) { wp_cache_debug( 'Removed tracking parameters from URL. Returning ' . $path . $query ); } return $path . $query; }