WordPress.org

Make WordPress Core

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

File permalink-field-for-public-post-types-only.14321.3.diff, 1.2 KB (added by filosofo, 3 years ago)
  • wp-admin/edit-form-advanced.php

     
    242242</div> 
    243243<div class="inside"> 
    244244<?php 
    245 $sample_permalink_html = get_sample_permalink_html($post->ID); 
     245$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : ''; 
    246246$shortlink = wp_get_shortlink($post->ID, 'post'); 
    247247if ( !empty($shortlink) ) 
    248248    $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>'; 
    249249 
    250 if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 
     250if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 
    251251        <div id="edit-slug-box"> 
    252252        <?php 
    253253                if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )