Created
May 12, 2015 14:09
-
-
Save roborourke/4ab95cf90f94e4d5243c to your computer and use it in GitHub Desktop.
Remove /blog slug from permalinks on WordPress multisite
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 | |
// disable /blog prefix on url permalinks | |
foreach ( array( 'permalink_structure', 'category_base', 'tag_base' ) as $option ) { | |
add_filter( "option_{$option}", function ( $value ) { | |
return preg_replace( '|^/?blog|', '', $value ); | |
}, 10, 1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment