Skip to content

Instantly share code, notes, and snippets.

@tlovett1
Created April 8, 2013 17:50
Show Gist options
  • Save tlovett1/5338867 to your computer and use it in GitHub Desktop.
Save tlovett1/5338867 to your computer and use it in GitHub Desktop.
<?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