WordPress.org

Make WordPress Core

Ticket #13918: t13918-permastruct-nag.diff

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

More sensible nagging to Change Permalinks

  • wp-admin/includes/post.php

     
    10901090 
    10911091        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { 
    10921092                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n"; 
    1093                 if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 
    1094                         $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; 
     1093                if ( ! get_option( 'permalink_structure' ) ) { 
     1094                        if ( current_user_can( 'manage_options' ) && !( 'page' == get_option( 'show_on_front' ) && $id == get_option( 'page_on_front' ) ) ) { 
     1095                                $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; 
     1096                        } 
     1097                } 
    10951098                if ( isset($view_post) ) 
    10961099                        $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n"; 
    10971100