Ticket #14321: permalink-field-for-public-post-types-only.14321.2.diff
| File permalink-field-for-public-post-types-only.14321.2.diff, 1.2 KB (added by filosofo, 3 years ago) |
|---|
-
wp-admin/edit-form-advanced.php
242 242 </div> 243 243 <div class="inside"> 244 244 <?php 245 $sample_permalink_html = get_sample_permalink_html($post->ID);245 $sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) || ! empty( $post_type_object->public ) ? get_sample_permalink_html($post->ID) : ''; 246 246 $shortlink = wp_get_shortlink($post->ID, 'post'); 247 247 if ( !empty($shortlink) ) 248 248 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 249 249 250 if ( ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>250 if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 251 251 <div id="edit-slug-box"> 252 252 <?php 253 253 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )
