WordPress.org

Make WordPress Core

Ticket #17040: 17040.2.diff

File 17040.2.diff, 3.6 KB (added by nacin, 7 years ago)
  • wp-includes/post.php

     
    3131
    3232        register_post_type( 'page', array(
    3333                'public' => true,
     34                'publicly_queryable' => false,
    3435                '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
    3536                '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
    3637                'capability_type' => 'page',
     
    41924193        if ( !$date ) {
    41934194                $add_seconds_server = date('Z');
    41944195
    4195                 $post_types = get_post_types( array( 'publicly_queryable' => true ) );
     4196                $post_types = get_post_types( array( 'public' => true ) );
    41964197                array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) );
    41974198                $post_types = "'" . implode( "', '", $post_types ) . "'";
    41984199
  • wp-admin/includes/class-wp-posts-list-table.php

     
    550550                                        if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
    551551                                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
    552552                                }
    553                                 if ( $post_type_object->publicly_queryable ) {
     553                                if ( $post_type_object->public ) {
    554554                                        if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {
    555555                                                if ( $can_edit_post )
    556556                                                        $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
  • wp-admin/includes/internal-linking.php

     
    1616 * @return array Results.
    1717 */
    1818function wp_link_query( $args = array() ) {
    19         $pts = get_post_types( array( 'publicly_queryable' => true ), 'objects' );
     19        $pts = get_post_types( array( 'public' => true ), 'objects' );
    2020        $pt_names = array_keys( $pts );
    2121
    2222        $query = array(
  • wp-admin/edit-form-advanced.php

     
    242242</div>
    243243<div class="inside">
    244244<?php
    245 $sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : '';
     245$sample_permalink_html = $post_type_object->public ? 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 ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
     250if ( $post_type_object->public && ! ( '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 )