http:// becomes http
-
Hello,
I have added the code below to the functions file to create a redirect. The problem is that it converts
http://tohttp%3A%2F%2Fand the redirect fails. Do you have a fix for this? Thanksadd_action( 'wpel_link', function ( $link ) { // check if link is an external links if ( $link->is_external() ) { // get current url $url = $link->get_attr( 'href' ); // set redirect url $redirect_url = '//somedom.com?url='. urlencode( $url ); $link->set_attr( 'href', $redirect_url ); } }, 10, 1 );
The topic ‘http:// becomes http’ is closed to new replies.