Fix CPT rewrite generation when turning on permalinks. Props andy. see #18040 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@18443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-07-15 15:49:42 +00:00
parent 7f88e6ee2f
commit 2d148f51de
1 changed files with 1 additions and 1 deletions

View File

@ -985,7 +985,7 @@ function register_post_type($post_type, $args = array()) {
$wp->add_query_var($args->query_var);
}
if ( false !== $args->rewrite && '' != get_option('permalink_structure') ) {
if ( false !== $args->rewrite && ( is_admin() || '' != get_option('permalink_structure') ) ) {
if ( ! is_array( $args->rewrite ) )
$args->rewrite = array();
if ( empty( $args->rewrite['slug'] ) )