WordPress.org

Make WordPress Core

Changeset 19779


Ignore:
Timestamp:
01/28/2012 09:00:59 PM (6 years ago)
Author:
duck_
Message:

Use new $args parameter for (WP_Rewrite::)add_permastruct(). Fixes #16092.

Use array_intersect_key() to keep WP_Rewrite::$extra_permastructs free of unnecessary/unknown keys + values.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r19744 r19779  
    10281028        }
    10291029
    1030         $wp_rewrite->add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->rewrite['ep_mask'] );
     1030        $wp_rewrite->add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite );
    10311031    }
    10321032
  • trunk/wp-includes/rewrite.php

    r19756 r19779  
    19141914            'endpoints' => true,
    19151915        );
     1916        $args = array_intersect_key( $args, $defaults );
    19161917        $args = wp_parse_args( $args, $defaults );
    19171918
  • trunk/wp-includes/taxonomy.php

    r19742 r19779  
    345345
    346346        $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
    347         $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front'], $args['rewrite']['ep_mask'] );
     347        $wp_rewrite->add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite'] );
    348348    }
    349349
Note: See TracChangeset for help on using the changeset viewer.