WordPress.org

Make WordPress Core

Ticket #18040: 18040.diff

File 18040.diff, 532 bytes (added by andy, 7 years ago)

add is_admin() check

  • wp-includes/post.php

     
    985985                $wp->add_query_var($args->query_var);
    986986        }
    987987
    988         if ( false !== $args->rewrite && '' != get_option('permalink_structure') ) {
     988        if ( false !== $args->rewrite && ( is_admin() || '' != get_option('permalink_structure') ) ) {
    989989                if ( ! is_array( $args->rewrite ) )
    990990                        $args->rewrite = array();
    991991                if ( empty( $args->rewrite['slug'] ) )