WordPress.org

Make WordPress Core

Ticket #13918: t13918-permastruct-nag-v2.diff

File t13918-permastruct-nag-v2.diff, 1.0 KB (added by demetris, 4 years ago)

Adds check to the same IF, without nesting

  • wp-admin/includes/post.php

     
    11171117 
    11181118        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { 
    11191119                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n"; 
    1120                 if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 
     1120                if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 
    11211121                        $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; 
    11221122                if ( isset($view_post) ) 
    11231123                        $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";