Skip to content

Commit

Permalink
Merge pull request #148 from mslinnea/add-filters
Browse files Browse the repository at this point in the history
Add filters for request path and redirect path
  • Loading branch information
tlovett1 authored Apr 3, 2018
2 parents 2719807 + 6e299e4 commit f84bc99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/classes/class-srm-redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function maybe_redirect() {
}

// get requested path and add a / before it
$requested_path = esc_url_raw( $_SERVER['REQUEST_URI'] );
$requested_path = esc_url_raw( apply_filters( 'srm_requested_path', $_SERVER['REQUEST_URI'] ) );
$requested_path = untrailingslashit( stripslashes( $requested_path ) );

/**
Expand Down Expand Up @@ -151,7 +151,7 @@ public function maybe_redirect() {
$redirect_to = preg_replace( '@' . $redirect_from . '@' . $regex_flag, $redirect_to, $requested_path );
}

$sanitized_redirect_to = esc_url_raw( $redirect_to );
$sanitized_redirect_to = esc_url_raw( apply_filters( 'srm_redirect_to', $redirect_to ) );

do_action( 'srm_do_redirect', $requested_path, $sanitized_redirect_to, $status_code );

Expand Down

0 comments on commit f84bc99

Please sign in to comment.