Skip to content

Commit

Permalink
#4326 - Some more improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
WasimM3 committed May 1, 2020
1 parent 0ecfdf1 commit 3c2a9b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions includes/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@ function ampforwp_redirection() {
$tax_status = ampforwp_get_taxonomy_meta($term_id,'status');
if($tax_status==false){
$go_to_url = home_url(add_query_arg($_GET,$wp->request));
$go_to_url = str_replace("/amp", '', $go_to_url);
$go_to_url = str_replace("?amp=1", '', $go_to_url);
$go_to_url = str_replace("?amp", '', $go_to_url);
$go_to_url = preg_replace('/amp$/', '', $go_to_url);
$go_to_url = preg_replace('/\?amp=1$/', '', $go_to_url);
$go_to_url = preg_replace('/\?amp$/', '', $go_to_url);
wp_safe_redirect( $go_to_url );
exit;
}
}else if(is_single()){
$tax_status = ampforwp_get_taxonomy_meta('','post_status');
if($tax_status==false){
$go_to_url = home_url(add_query_arg($_GET,$wp->request));
$go_to_url = str_replace("/amp", '', $go_to_url);
$go_to_url = str_replace("?amp=1", '', $go_to_url);
$go_to_url = str_replace("?amp", '', $go_to_url);
$go_to_url = preg_replace('/amp$/', '', $go_to_url);
$go_to_url = preg_replace('/\?amp=1$/', '', $go_to_url);
$go_to_url = preg_replace('/\?amp$/', '', $go_to_url);
wp_safe_redirect( $go_to_url );
exit;
}
Expand Down

0 comments on commit 3c2a9b7

Please sign in to comment.