WordPress.org

Make WordPress Core

Ticket #11863: 11863.patch

File 11863.patch, 1.9 KB (added by ericlewis, 8 years ago)

Updated version of conflict5.patch to apply cleanly to trunk. Added link to current post if the conflicting post is published, leave link to trash if that's where it is.

  • wp-admin/includes/post.php

     
    11141114                }
    11151115        }
    11161116
     1117        // Permalink conflict error messages.
     1118        if ( $new_slug && $new_slug != $post_name_abridged ) {
     1119                echo '<div id="message" class="error"><p>';
     1120                $conflicting_post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_name = %s;",$new_slug));
     1121                if ( $conflicting_post->post_status == 'trash' ) {
     1122                        _e('There was a permalink conflict with the post "' . $post->post_title . '" in the trash. <a href="edit.php?post_status=trash&amp;post_type=' . $post->post_type . '">View Trash</a>');
     1123                } else {
     1124                        $conflicting_post_edit_link_url = get_edit_post_link($conflicting_post->ID);
     1125                        $post_type_obj = get_post_type_object( $post->post_type );
     1126                        $conflicting_post_edit_link_html = '<a class="post-edit-link" href="' . $conflicting_post_edit_link_url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $conflicting_post->post_title . '</a>'; 
     1127                        if ( !empty($conflicting_post) )
     1128                                _e('There was a permalink conflict with the post ' . $conflicting_post_edit_link_html . ', a unique numerical string has been appended to the permalink.');
     1129                }
     1130                echo '</p></div>';
     1131        }
     1132
    11171133        $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
    11181134        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
    11191135        $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
  • wp-admin/css/wp-admin.dev.css

     
    29322932}
    29332933
    29342934#edit-slug-box {
    2935         height: 1em;
    29362935        margin-top: 8px;
    29372936        padding: 0 10px;
    29382937}