Antwort: Re: [wp-hackers] Adding rewrite rules to wp

Gerhard Brauckmann Gerhard.Brauckmann at
Mon Oct 1 14:20:52 GMT 2007

Austin, many thx for your feedback,

mmmhhhhh  doesnt work, maybe it's an 2.3 version issue? 

my query_var PART ist still not an item in the rules array, nor can I get 
it by using get_query_var ('part')

its only working $wp_rewrite->permalink_structure/?part=334

Gerhard Brauckmann

"Austin Matzko" < at> 
Gesendet von: wp-hackers-bounces at
01.10.2007 14:53
Bitte antworten an
wp-hackers at

wp-hackers at

Re: [wp-hackers] Adding rewrite rules to wp

On 10/1/07, Gerhard Brauckmann <Gerhard.Brauckmann at> wrote:
> /* add PARTS List to specific POST  */
> /* example: http://mydomain/2007/09/31/xmas-tools-44/part/334  */
> /* this should pass to post /2007/09/31/xmas-tools-44 */
> /* whithin single.php axtract query_var (part) with token 334  - do
> somenting with the value */

I think the following is what you want, as it will set a query var of
"part" to "334" for something like

function MI_Parts() {
       add_action('init', array(&$this, 'mi_initRewrite'));
       add_filter('post_rewrite_rules', array(&$this, 
} // end of initialization

function mi_initRewrite() {
        add_rewrite_tag('%part%', 'part/(.+)');

function mi_createRewriteRules($rewrite) {
        global $wp_rewrite;
        $keywords_structure = $wp_rewrite->permalink_structure . 
        $keywords_rewrite =
        return ( $rewrite + $keywords_rewrite );
} // of CLASS
wp-hackers mailing list
wp-hackers at

More information about the wp-hackers mailing list