[wp-hackers] WP_Rewrite: Disable post/Page paging ability?

Viper007Bond viper at viper007bond.com
Wed Jul 23 07:17:37 GMT 2008


Got it sorted (finally). My regex skills suck, but this seems to do the
trick, so whatever. :)


function allow_numeric_stubs( $rules ) {
    unset( $rules['(.+?)(/[0-9]+)?/?$'] );

    $rules['(.+?)?/?$'] = 'index.php?pagename=$matches[1]';

    return $rules;
}

add_filter( 'page_rewrite_rules', 'allow_numeric_stubs' );

-- 
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/


More information about the wp-hackers mailing list