Guest User

Untitled

a guest
Jul 16th, 2012
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function baw_hack_cat( $wp )
  2. {
  3.     global $wp_query, $wp;
  4.     if( $wp_query->query_vars['category_name'] != $wp_query->query['category_name'] ):
  5.         wp_redirect( home_url( str_replace( $wp_query->query['category_name'], $wp_query->query_vars['category_name'], $wp->request ) ), 301 );
  6.         die();
  7.     endif;
  8. }
  9. add_action( 'wp', 'baw_hack_cat' );
RAW Paste Data