<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32754] trunk/src/wp-admin/includes/class-wp-media-list-table.php: In `WP_Media_List_Table::display_rows()`:</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32754">32754</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32754","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-06-13 15:56:13 +0000 (Sat, 13 Jun 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>In `WP_Media_List_Table::display_rows()`:
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`
See <a href="https://core.trac.wordpress.org/ticket/29881">#29881</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpmedialisttablephp">trunk/src/wp-admin/includes/class-wp-media-list-table.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpmedialisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-media-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-media-list-table.php 2015-06-13 15:32:57 UTC (rev 32753)
+++ trunk/src/wp-admin/includes/class-wp-media-list-table.php 2015-06-13 15:56:13 UTC (rev 32754)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,223 +311,247 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.3.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global WP_Post $post
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Post $post
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function display_rows() {
- global $post;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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 }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'the_title','esc_html' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_title( $post ) {
+ list( $mime ) = explode( '/', $post->post_mime_type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while ( have_posts() ) : the_post();
- $user_can_edit = current_user_can( 'edit_post', $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_can_edit = current_user_can( 'edit_post', $post->ID );
+ $att_title = _draft_or_post_title();
+ ?>
+ <div class="media-icon <?php echo $mime ?>-icon">
+ <?php
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $this->is_trash && $post->post_status != 'trash'
- || !$this->is_trash && $post->post_status == 'trash' )
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true );
+ if ( $thumb ) {
+ if ( $this->is_trash || ! $user_can_edit ) {
+ echo $thumb;
+ } else { ?>
+ <a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php
+ echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) );
+ ?>"><?php echo $thumb; ?></a><?php
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>">
-<?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
+ </div>
+ <div class="media-info">
+ <strong>
+ <?php
+ if ( $this->is_trash || ! $user_can_edit ) {
+ echo $att_title;
+ } else { ?>
+ <a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php
+ echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) );
+ ?>"><?php echo $att_title; ?></a><?php
+ }
+ _media_states( $post );
+ ?>
+ </strong>
+ <p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
+ </div>
+ <?php
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
-
-foreach ( $columns as $column_name => $column_display_name ) {
- $classes = "$column_name column-$column_name";
- if ( $primary === $column_name ) {
- $classes .= ' has-row-actions column-primary';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_author( $post ) {
+ printf( '<a href="%s">%s</a>',
+ esc_url( add_query_arg( array( 'author' => get_the_author_meta('ID') ), 'upload.php' ) ),
+ get_the_author()
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $column_name, $hidden ) ) {
- $classes .= ' hidden';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_desc( $post ) {
+ echo has_excerpt() ? $post->post_excerpt : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attributes = "class='$classes'";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_date( $post ) {
+ if ( '0000-00-00 00:00:00' == $post->post_date ) {
+ $h_time = __( 'Unpublished' );
+ } else {
+ $m_time = $post->post_date;
+ $time = get_post_time( 'G', true, $post, false );
+ if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
+ if ( $t_diff < 0 ) {
+ $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
+ } else {
+ $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
+ }
+ } else {
+ $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'cb' === $column_name ) {
-?>
- <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
- } else {
- echo "<td $attributes>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo $h_time;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch ( $column_name ) {
- case 'title':
- list( $mime ) = explode( '/', $post->post_mime_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_parent( $post ) {
+ $user_can_edit = current_user_can( 'edit_post', $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<div class='media-icon {$mime}-icon'>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post->post_parent > 0 ) {
+ $parent = get_post( $post->post_parent );
+ } else {
+ $parent = false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true ) ) {
- if ( $this->is_trash || ! $user_can_edit ) {
- echo $thumb;
- } else { ?>
- <a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>">
- <?php echo $thumb; ?>
- </a><?php
- }
- }
-
- echo '</div><div class="media-info">';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parent ) {
+ $title = _draft_or_post_title( $post->post_parent );
+ $parent_type = get_post_type_object( $parent->post_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <strong>
- <?php if ( $this->is_trash || ! $user_can_edit ) {
- echo $att_title;
- } else { ?>
- <a href="<?php echo get_edit_post_link( $post->ID ); ?>"
- title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>">
- <?php echo $att_title; ?></a>
- <?php }
- _media_states( $post ); ?></strong>
- <p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
- </div>
-<?php
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <strong>
+ <?php if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) { ?>
+ <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
+ <?php echo $title ?></a><?php
+ } else {
+ echo $title;
+ } ?></strong>,
+ <?php echo get_the_time( __( 'Y/m/d' ) ); ?><br />
+ <?php
+ if ( $user_can_edit ):
+ $detach_url = add_query_arg( array(
+ 'parent_post_id' => $post->post_parent,
+ 'media[]' => $post->ID,
+ '_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] )
+ ), 'upload.php' ); ?>
+ <a class="hide-if-no-js detach-from-parent" href="<?php echo $detach_url ?>"><?php _e( 'Detach' ); ?></a>
+ <?php endif;
+ } else {
+ _e( '(Unattached)' ); ?><br />
+ <?php if ( $user_can_edit ) { ?>
+ <a class="hide-if-no-js"
+ onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' ); return false;"
+ href="#the-list">
+ <?php _e( 'Attach' ); ?></a>
+ <?php }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'author':
- printf( '<a href="%s">%s</a>',
- esc_url( add_query_arg( array( 'author' => get_the_author_meta('ID') ), 'upload.php' ) ),
- get_the_author()
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ */
+ public function column_comments( $post ) {
+ echo '<div class="post-com-count-wrapper">';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pending_comments = get_pending_comments_num( $post->ID );
+ $this->comments_bubble( $post->ID, $pending_comments );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'desc':
- echo has_excerpt() ? $post->post_excerpt : '';
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '</div>';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'date':
- if ( '0000-00-00 00:00:00' == $post->post_date ) {
- $h_time = __( 'Unpublished' );
- } else {
- $m_time = $post->post_date;
- $time = get_post_time( 'G', true, $post, false );
- if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
- if ( $t_diff < 0 )
- $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
- else
- $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
- } else {
- $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Post $post
+ * @param string $column_name
+ */
+ public function column_default( $post, $column_name ) {
+ if ( 'categories' == $column_name ) {
+ $taxonomy = 'category';
+ } elseif ( 'tags' == $column_name ) {
+ $taxonomy = 'post_tag';
+ } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
+ $taxonomy = substr( $column_name, 9 );
+ } else {
+ $taxonomy = false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo $h_time;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $taxonomy ) {
+ $terms = get_the_terms( $post->ID, $taxonomy );
+ if ( is_array( $terms ) ) {
+ $out = array();
+ foreach ( $terms as $t ) {
+ $posts_in_term_qv = array();
+ $posts_in_term_qv['taxonomy'] = $taxonomy;
+ $posts_in_term_qv['term'] = $t->slug;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'parent':
- if ( $post->post_parent > 0 )
- $parent = get_post( $post->post_parent );
- else
- $parent = false;
-
- if ( $parent ) {
- $title = _draft_or_post_title( $post->post_parent );
- $parent_type = get_post_type_object( $parent->post_type );
- ?>
- <strong>
- <?php if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) { ?>
- <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
- <?php echo $title ?></a><?php
- } else {
- echo $title;
- } ?></strong>,
- <?php echo get_the_time( __( 'Y/m/d' ) ); ?><br />
- <?php
- if ( $user_can_edit ):
- $detach_url = add_query_arg( array(
- 'parent_post_id' => $post->post_parent,
- 'media[]' => $post->ID,
- '_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] )
- ), 'upload.php' ); ?>
- <a class="hide-if-no-js detach-from-parent" href="<?php echo $detach_url ?>"><?php _e( 'Detach' ); ?></a>
- <?php endif;
- } else {
- _e( '(Unattached)' ); ?><br />
- <?php if ( $user_can_edit ) { ?>
- <a class="hide-if-no-js"
- onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' ); return false;"
- href="#the-list">
- <?php _e( 'Attach' ); ?></a>
- <?php }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $out[] = sprintf( '<a href="%s">%s</a>',
+ esc_url( add_query_arg( $posts_in_term_qv, 'upload.php' ) ),
+ esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: used between list items, there is a space after the comma */
+ echo join( __( ', ' ), $out );
+ } else {
+ echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->not_found . '</span>';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'comments':
- echo '<div class="post-com-count-wrapper">';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires for each custom column in the Media list table.
+ *
+ * Custom columns are registered using the {@see 'manage_media_columns'} filter.
+ *
+ * @since 2.5.0
+ *
+ * @param string $column_name Name of the custom column.
+ * @param int $post_id Attachment ID.
+ */
+ do_action( 'manage_media_custom_column', $column_name, $post->ID );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pending_comments = get_pending_comments_num( $post->ID );
- $this->comments_bubble( $post->ID, $pending_comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ *
+ * @global WP_Post $post
+ */
+ public function display_rows() {
+ global $post;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'the_title','esc_html' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
-
- default:
- if ( 'categories' == $column_name )
- $taxonomy = 'category';
- elseif ( 'tags' == $column_name )
- $taxonomy = 'post_tag';
- elseif ( 0 === strpos( $column_name, 'taxonomy-' ) )
- $taxonomy = substr( $column_name, 9 );
- else
- $taxonomy = false;
-
- if ( $taxonomy ) {
- $terms = get_the_terms( $post->ID, $taxonomy );
- if ( is_array( $terms ) ) {
- $out = array();
- foreach ( $terms as $t ) {
- $posts_in_term_qv = array();
- $posts_in_term_qv['taxonomy'] = $taxonomy;
- $posts_in_term_qv['term'] = $t->slug;
-
- $out[] = sprintf( '<a href="%s">%s</a>',
- esc_url( add_query_arg( $posts_in_term_qv, 'upload.php' ) ),
- esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
- );
- }
- /* translators: used between list items, there is a space after the comma */
- echo join( __( ', ' ), $out );
- } else {
- echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->not_found . '</span>';
- }
-
- break;
- }
-
- /**
- * Fires for each custom column in the Media list table.
- *
- * Custom columns are registered using the {@see 'manage_media_columns'} filter.
- *
- * @since 2.5.0
- *
- * @param string $column_name Name of the custom column.
- * @param int $post_id Attachment ID.
- */
- do_action( 'manage_media_custom_column', $column_name, $post->ID );
- break;
- }
-
- if( $primary === $column_name ) {
- echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
- }
-
- echo '</td>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while ( have_posts() ) : the_post();
+ if (
+ ( $this->is_trash && $post->post_status != 'trash' )
+ || ( ! $this->is_trash && $post->post_status == 'trash' )
+ ) {
+ continue;
+ }
+ $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
+ ?>
+ <tr id="post-<?php echo $post->ID; ?>" class="<?php echo trim( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>">
+ <?php $this->single_row_columns( $post ); ?>
+ </tr>
+ <?php
+ endwhile;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
-?>
- </tr>
-<?php endwhile;
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the name of the default primary column.
</span></span></pre>
</div>
</div>
</body>
</html>