mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Don't show permalink box unless the post type is publicly queryable. Props filosofo. Fixes #14321
git-svn-id: http://svn.automattic.com/wordpress/trunk@16666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0c8a8c3655
commit
9c8582d681
@ -243,12 +243,12 @@ $side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
|
||||
</div>
|
||||
<div class="inside">
|
||||
<?php
|
||||
$sample_permalink_html = get_sample_permalink_html($post->ID);
|
||||
$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : '';
|
||||
$shortlink = wp_get_shortlink($post->ID, 'post');
|
||||
if ( !empty($shortlink) )
|
||||
$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>';
|
||||
|
||||
if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
|
||||
if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
|
||||
<div id="edit-slug-box">
|
||||
<?php
|
||||
if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )
|
||||
|
Loading…
Reference in New Issue
Block a user