Created
April 8, 2013 17:50
-
-
Save tlovett1/5338867 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function vb_catch_bitmob_redirect() { | |
if ( ! empty( $_GET['bitmob_redirect'] ) ) { | |
$redirect_post = get_page_by_path( $_GET['bitmob_redirect'], OBJECT, 'post' ); | |
if ( ! empty( $redirect_post ) ) | |
wp_safe_redirect( get_permalink( $redirect_post->ID ), 301 ); | |
} | |
} | |
add_action( 'parse_request', 'vb_catch_bitmob_redirect' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment