From 856c2742cafd2d975fb210657846b0e478ce0ff2 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Fri, 10 Jun 2011 17:02:03 +0000 Subject: [PATCH] Fix mistaken use of publicly_queryable when public was what was intended. props nacin. fixes #17040 git-svn-id: http://svn.automattic.com/wordpress/trunk@18234 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 4 ++-- wp-admin/includes/class-wp-posts-list-table.php | 2 +- wp-admin/includes/internal-linking.php | 2 +- wp-includes/post.php | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 10cb0e61e..aed7b647d 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -241,12 +241,12 @@ $side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
publicly_queryable ) ? get_sample_permalink_html($post->ID) : ''; +$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; $shortlink = wp_get_shortlink($post->ID, 'post'); if ( !empty($shortlink) ) $sample_permalink_html .= '' . __('Get Shortlink') . ''; -if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> +if ( $post_type_object->public && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 776b2d98d..bdd24a62e 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -550,7 +550,7 @@ class WP_Posts_List_Table extends WP_List_Table { if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) $actions['delete'] = "" . __( 'Delete Permanently' ) . ""; } - if ( $post_type_object->publicly_queryable ) { + if ( $post_type_object->public ) { if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) { if ( $can_edit_post ) $actions['view'] = '' . __( 'Preview' ) . ''; diff --git a/wp-admin/includes/internal-linking.php b/wp-admin/includes/internal-linking.php index 6aa9290c6..a95c01b9f 100644 --- a/wp-admin/includes/internal-linking.php +++ b/wp-admin/includes/internal-linking.php @@ -16,7 +16,7 @@ * @return array Results. */ function wp_link_query( $args = array() ) { - $pts = get_post_types( array( 'publicly_queryable' => true ), 'objects' ); + $pts = get_post_types( array( 'public' => true ), 'objects' ); $pt_names = array_keys( $pts ); $query = array( diff --git a/wp-includes/post.php b/wp-includes/post.php index 151b66254..1a28e4a05 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -31,6 +31,7 @@ function create_initial_post_types() { register_post_type( 'page', array( 'public' => true, + 'publicly_queryable' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'page', @@ -4204,7 +4205,7 @@ function _get_last_post_time( $timezone, $field ) { if ( !$date ) { $add_seconds_server = date('Z'); - $post_types = get_post_types( array( 'publicly_queryable' => true ) ); + $post_types = get_post_types( array( 'public' => true ) ); array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) ); $post_types = "'" . implode( "', '", $post_types ) . "'";