Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Filter login url
- */
- function streamtube_child_filter_login_url( $login_url, $redirect, $force_reauth ){
- // Define your custom login url here
- $new_login_url = 'your custom login url';
- if ( ! empty( $redirect ) ) {
- $custom_login_page_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $new_login_url );
- }
- if ( $force_reauth ) {
- $new_login_url = add_query_arg( 'reauth', '1', $login_url );
- }
- return $new_login_url;
- }
- add_filter( 'login_url', 'streamtube_child_filter_login_url', 100, 3 );
- /**
- *
- * Filter logout url
- *
- */
- function streamtube_child_filter_logout_url( $logout_url, $redirect ){
- // Define your custom logout url here
- $new_logout_url = 'your custom logout url';
- $args = array();
- if ( ! empty( $redirect ) ) {
- $args['redirect_to'] = urlencode( $redirect );
- }
- $new_logout_url = add_query_arg( $args, $new_logout_url );
- $new_logout_url = wp_nonce_url( $new_logout_url, 'log-out' );
- return $new_logout_url;
- }
- add_filter( 'logout_url', 'streamtube_child_filter_logout_url', 100, 2 );
Add Comment
Please, Sign In to add comment