WordPress.org

Make WordPress Core

Ticket #14321: permalink-field-for-public-post-types-only.14321.diff

File permalink-field-for-public-post-types-only.14321.diff, 816 bytes (added by filosofo, 5 years ago)
  • wp-admin/edit-form-advanced.php

     
    243243</div> 
    244244<div class="inside"> 
    245245<?php 
    246 $sample_permalink_html = get_sample_permalink_html($post->ID); 
     246$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) || ! empty( $post_type_object->public ) ? get_sample_permalink_html($post->ID) : ''; 
    247247$shortlink = wp_get_shortlink($post->ID, 'post'); 
    248248if ( !empty($shortlink) ) 
    249249    $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';