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
This commit is contained in:
Ryan Boren 2011-07-15 15:49:42 +00:00
parent 4dcfeabff1
commit f39604511e

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'] ) )