WordPress.org

Make WordPress Core

Changeset 16666


Ignore:
Timestamp:
12/01/10 20:21:00 (3 years ago)
Author:
scribu
Message:

Don't show permalink box unless the post type is publicly queryable. Props filosofo. Fixes #14321

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r16657 r16666  
    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 ) ? 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>'; 
    250250 
    251 if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 
     251if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 
    252252    <div id="edit-slug-box"> 
    253253    <?php 
Note: See TracChangeset for help on using the changeset viewer.