Make WordPress Core

Ticket #13499: internal-link-show-post-parent.patch

File internal-link-show-post-parent.patch, 2.3 KB (added by DreadLox, 13 years ago)

Patch to show posts's parent in internal linking editor's dialog

  • wp-includes/js/tinymce/plugins/wplink/css/wplink.dev.css

     
    8181        font-size: 11px;
    8282        float: right;
    8383}
     84#wp-link .item-parent {
     85        color: #666;
     86        font-size: 10px;
     87
     88        display: block;
     89}
    8490#search-results {
    8591        display: none;
    8692}
     
    105111#wp-link-update {
    106112        line-height: 23px;
    107113        float: right;
    108 }
    109  No newline at end of file
     114}
  • wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js

     
    356356                                        list += '<input type="hidden" class="item-permalink" value="' + this['permalink'] + '" />';
    357357                                        list += '<span class="item-title">';
    358358                                        list += this['title'] ? this['title'] : '<em>'+ wpLinkL10n.untitled + '</em>';
    359                                         list += '</span><span class="item-info">' + this['info'] + '</span></li>';
     359                                        list += '</span>';
     360                                       
     361                                        list += '<span class="item-info">' + this['info'] + '</span>';
     362                                        if( this['parent'] )
     363                                                list += '<span class="item-parent">' + this['parent'] + '</span>';
     364                                        list += '</li>';
    360365                                        alt = ! alt;
    361366                                });
    362367                        }
     
    419424        });
    420425
    421426        $(document).ready( wpLink.init );
    422 })(jQuery);
    423  No newline at end of file
     427})(jQuery);
  • wp-admin/includes/internal-linking.php

     
    5252                else
    5353                        $info = $pts[ $post->post_type ]->labels->singular_name;
    5454
     55                $parent = '';                   
     56                if($post->post_parent) {
     57                        $parent_post = get_post($post->post_parent);
     58                        $parent = __('Parent:') . ' ' . esc_html( strip_tags($parent_post->post_title) );
     59                }
     60                       
    5561                $results[] = array(
    5662                        'ID' => $post->ID,
    5763                        'title' => esc_html( strip_tags($post->post_title) ),
    5864                        'permalink' => get_permalink( $post->ID ),
    5965                        'info' => $info,
     66                        'parent' => $parent
    6067                );
    6168        }
    6269
     
    119126</form>
    120127<?php
    121128}
    122 ?>
    123  No newline at end of file
     129?>