- function display_rows() {
- global $post;
-
- add_filter( 'the_title','esc_html' );
- $alt = '';
-
- while ( have_posts() ) : the_post();
- $user_can_edit = current_user_can( 'edit_post', $post->ID );
-
- if ( $this->is_trash && $post->post_status != 'trash'
- || !$this->is_trash && $post->post_status == 'trash' )
- continue;
-
- $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
- $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
- $att_title = _draft_or_post_title();
-?>
- <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
-<?php
-
-list( $columns, $hidden ) = $this->get_column_info();
-foreach ( $columns as $column_name => $column_display_name ) {
- $class = "class='$column_name column-$column_name'";
-
- $style = '';
- if ( in_array( $column_name, $hidden ) )
- $style = ' style="display:none;"';
-
- $attributes = $class . $style;
-
- switch ( $column_name ) {
-
- case 'cb':
-?>
- <th scope="row" class="check-column">
- <?php if ( $user_can_edit ) { ?>
- <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php echo sprintf( __( 'Select %s' ), $att_title );?></label>
- <input type="checkbox" name="media[]" id="cb-select-<?php the_ID(); ?>" value="<?php the_ID(); ?>" />
- <?php } ?>
- </th>
-<?php
- break;
-
- case 'icon':
- $attributes = 'class="column-icon media-icon"' . $style;
-?>
- <td <?php echo $attributes ?>><?php
- if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) {
- if ( $this->is_trash || ! $user_can_edit ) {
- echo $thumb;
- } else {
-?>
- <a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>">
- <?php echo $thumb; ?>
- </a>
+ /**
+ * Handles the checkbox column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param WP_Post $post The current WP_Post object.
+ */
+ public function column_cb( $post ) {
+ if ( current_user_can( 'edit_post', $post->ID ) ) { ?>
+ <label class="screen-reader-text" for="cb-select-<?php echo $post->ID; ?>"><?php
+ echo sprintf( __( 'Select %s' ), _draft_or_post_title() );
+ ?></label>
+ <input type="checkbox" name="media[]" id="cb-select-<?php echo $post->ID; ?>" value="<?php echo $post->ID; ?>" />
+ <?php }
+ }