From f39604511e496140da9fccf96c9c72df1bf58153 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 15 Jul 2011 15:49:42 +0000 Subject: [PATCH] Fix CPT rewrite generation when turning on permalinks. Props andy. see #18040 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@18443 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 0cf04d55e9..d17e118e21 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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'] ) )