X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/b137f4ce021b4022c56f452c2eafa7abfcef0a7c..38ca813a0e312e2768e5b9519f0415cd0aa84781:/wp-admin/includes/class-wp-posts-list-table.php diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index c1b4c344..bdd24a62 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -45,7 +45,7 @@ class WP_Posts_List_Table extends WP_List_Table { */ var $sticky_posts_count = 0; - function WP_Posts_List_Table() { + function __construct() { global $post_type_object, $post_type, $wpdb; if ( !isset( $_REQUEST['post_type'] ) ) @@ -74,7 +74,7 @@ class WP_Posts_List_Table extends WP_List_Table { $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status != 'trash' AND ID IN ($sticky_posts)", $post_type ) ); } - parent::WP_List_Table( array( + parent::__construct( array( 'plural' => 'posts', ) ); } @@ -281,7 +281,7 @@ class WP_Posts_List_Table extends WP_List_Table { $post_status = !empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all'; if ( post_type_supports( $post_type, 'comments' ) && !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) ) - $posts_columns['comments'] = '
' . esc_attr__( 'Comments' ) . '
'; + $posts_columns['comments'] = '' . esc_attr__( 'Comments' ) . ''; $posts_columns['date'] = __( 'Date' ); @@ -550,11 +550,13 @@ class WP_Posts_List_Table extends WP_List_Table { if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) $actions['delete'] = "" . __( 'Delete Permanently' ) . ""; } - if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) { - if ( $can_edit_post ) - $actions['view'] = '' . __( 'Preview' ) . ''; - } elseif ( 'trash' != $post->post_status ) { - $actions['view'] = '' . __( 'View' ) . ''; + if ( $post_type_object->public ) { + if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) { + if ( $can_edit_post ) + $actions['view'] = '' . __( 'Preview' ) . ''; + } elseif ( 'trash' != $post->post_status ) { + $actions['view'] = '' . __( 'View' ) . ''; + } } $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post ); @@ -1003,6 +1005,7 @@ class WP_Posts_List_Table extends WP_List_Table { } ?> +