<!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>[33270] trunk/src/wp-admin/includes: List Tables:</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/33270">33270</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/33270","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-07-14 17:46:13 +0000 (Tue, 14 Jul 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'>List Tables:
* In `->handle_row_actions()`, bail immediately if `$primary` and `$column_name` do not match. Saves us a nesting level and avoids declaring code that is unusable.
* In `WP_List_Table::single_row_columns()`, allow `_column_{$name}` to be called dynamically by core to avoid having to override the entirety of `->single_row_columns()` in `WP_MS_Users_List_Table` and `WP_Posts_List_Table`
* In `WP_MS_Sites_List_Table`, `id` is not a column.
Props wonderboymusic, paulwilde.
Fixes <a href="https://core.trac.wordpress.org/ticket/29881">#29881</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpcommentslisttablephp">trunk/src/wp-admin/includes/class-wp-comments-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswplinkslisttablephp">trunk/src/wp-admin/includes/class-wp-links-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswplisttablephp">trunk/src/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmedialisttablephp">trunk/src/wp-admin/includes/class-wp-media-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmssiteslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmsuserslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswppostslisttablephp">trunk/src/wp-admin/includes/class-wp-posts-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswptermslisttablephp">trunk/src/wp-admin/includes/class-wp-terms-list-table.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpcommentslisttablephp"></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-comments-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-comments-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-comments-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -462,14 +462,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $comment, $column_name, $primary ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $comment_status;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->user_can ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><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 ( $primary !== $column_name ) {
- return '';
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $the_comment_status = wp_get_comment_status( $comment->comment_ID );
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswplinkslisttablephp"></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-links-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-links-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-links-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,13 +310,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row action output for links.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $link, $column_name, $primary ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $primary === $column_name ) {
- $edit_link = get_edit_bookmark_link( $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ 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">- $actions = array();
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
- return $this->row_actions($actions);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $edit_link = get_edit_bookmark_link( $link );
+
+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
+ return $this->row_actions( $actions );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswplisttablephp"></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-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-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1224,14 +1224,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<th scope="row" class="check-column">';
</span><span class="cx" style="display: block; padding: 0 10px"> echo $this->column_cb( $item );
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</th>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- elseif ( method_exists( $this, 'column_' . $column_name ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
+ echo call_user_func(
+ array( $this, '_column_' . $column_name ),
+ $item,
+ $classes,
+ $data,
+ $primary
+ );
+ } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo "<td $attributes>";
</span><span class="cx" style="display: block; padding: 0 10px"> echo call_user_func( array( $this, 'column_' . $column_name ), $item );
</span><span class="cx" style="display: block; padding: 0 10px"> echo $this->handle_row_actions( $item, $column_name, $primary );
</span><span class="cx" style="display: block; padding: 0 10px"> echo "</td>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo "<td $attributes>";
</span><span class="cx" style="display: block; padding: 0 10px"> echo $this->column_default( $item, $column_name );
</span><span class="cx" style="display: block; padding: 0 10px"> echo $this->handle_row_actions( $item, $column_name, $primary );
</span></span></pre></div>
<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-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-media-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,9 +647,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row actions output for media attachments.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $post, $column_name, $primary ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $primary === $column_name ) {
- $att_title = _draft_or_post_title();
- return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ return '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $att_title = _draft_or_post_title();
+ return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmssiteslisttablephp"></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-ms-sites-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-ms-sites-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,62 +409,7 @@
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Handles columns output for a single row.
</del><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.3.0
- * @access public
- *
- * @param array $item Current site.
- */
- public function single_row_columns( $item ) {
- 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';
- }
-
- if ( in_array( $column_name, $hidden ) ) {
- $classes .= ' hidden';
- }
-
- $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
-
- $attributes = "class='$classes' $data";
-
- if ( 'cb' === $column_name ) {
- echo '<th scope="row" class="check-column">';
-
- $this->column_cb( $item );
-
- echo '</th>';
- } elseif ( 'id' === $column_name ) {
-?>
- <th scope="row">
- <?php echo $item['blog_id'] ?>
- </th>
-<?php
- } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
- echo "<td $attributes>";
-
- echo call_user_func( array( $this, 'column_' . $column_name ), $item );
-
- echo $this->handle_row_actions( $item, $column_name, $primary );
- echo "</td>";
- } else {
- echo "<td $attributes>";
-
- echo $this->column_default( $item, $column_name );
-
- echo $this->handle_row_actions( $item, $column_name, $primary );
- echo "</td>";
- }
- }
- }
-
- /**
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @global string $mode
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function display_rows() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,64 +455,66 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row actions output.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $blog, $column_name, $primary ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $primary === $column_name ) {
- $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ 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">- // Preordered.
- $actions = array(
- 'edit' => '', 'backend' => '',
- 'activate' => '', 'deactivate' => '',
- 'archive' => '', 'unarchive' => '',
- 'spam' => '', 'unspam' => '',
- 'delete' => '',
- 'visit' => '',
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
- $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
- if ( get_current_site()->blog_id != $blog['blog_id'] ) {
- if ( $blog['deleted'] == '1' ) {
- $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a></span>';
- } else {
- $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a></span>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Preordered.
+ $actions = array(
+ 'edit' => '', 'backend' => '',
+ 'activate' => '', 'deactivate' => '',
+ 'archive' => '', 'unarchive' => '',
+ 'spam' => '', 'unspam' => '',
+ 'delete' => '',
+ 'visit' => '',
+ );
</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 ( $blog['archived'] == '1' ) {
- $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
- } else {
- $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
+ $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
+ if ( get_current_site()->blog_id != $blog['blog_id'] ) {
+ if ( $blog['deleted'] == '1' ) {
+ $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a></span>';
+ } else {
+ $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a></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">- if ( $blog['spam'] == '1' ) {
- $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
- } else {
- $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $blog['archived'] == '1' ) {
+ $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
+ } else {
+ $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></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">- if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
- $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a></span>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $blog['spam'] == '1' ) {
+ $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
+ } else {
+ $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
</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">- $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
+ $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a></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">- /**
- * Filter the action links displayed for each site in the Sites list table.
- *
- * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
- * default for each site. The site's status determines whether to show the
- * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
- * 'Not Spam' or 'Spam' link for each site.
- *
- * @since 3.1.0
- *
- * @param array $actions An array of action links to be displayed.
- * @param int $blog_id The site ID.
- * @param string $blogname Site path, formatted depending on whether it is a sub-domain
- * or subdirectory multisite install.
- */
- $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
- return $this->row_actions( $actions );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
+
+ /**
+ * Filter the action links displayed for each site in the Sites list table.
+ *
+ * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
+ * default for each site. The site's status determines whether to show the
+ * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
+ * 'Not Spam' or 'Spam' link for each site.
+ *
+ * @since 3.1.0
+ *
+ * @param array $actions An array of action links to be displayed.
+ * @param int $blog_id The site ID.
+ * @param string $blogname Site path, formatted depending on whether it is a sub-domain
+ * or subdirectory multisite install.
+ */
+ $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
+ return $this->row_actions( $actions );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmsuserslisttablephp"></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-ms-users-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-ms-users-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,6 +257,22 @@
</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
+ * @access protected
+ *
+ * @param WP_User $user
+ * @param string $classes
+ * @param string $data
+ * @param string $primary
+ */
+ protected function _column_blogs( $user, $classes, $data, $primary ) {
+ echo '<td class="', $classes, ' has-row-actions" ', $data, '>';
+ echo $this->column_blogs( $user );
+ echo $this->handle_row_actions( $user, 'blogs', $primary );
+ echo '</td>';
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Handles the blogs/sites column output.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -335,59 +351,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
</span><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">- /**
- * Handles columns output for a single row in the table.
- *
- * @since 4.3.0
- * @access public
- *
- * @param WP_User $item The current WP_User object.
- */
- public function single_row_columns( $item ) {
- 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 || 'blogs' === $column_name ) {
- $classes .= ' has-row-actions';
- }
-
- if ( $primary === $column_name ) {
- $classes .= ' column-primary';
- }
-
- if ( in_array( $column_name, $hidden ) ) {
- $classes .= ' hidden';
- }
-
- $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
-
- $attributes = "class='$classes' $data";
-
- if ( 'cb' === $column_name ) {
- echo '<th scope="row" class="check-column">';
-
- $this->column_cb( $item );
-
- echo '</th>';
- } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
- echo "<td $attributes>";
-
- call_user_func( array( $this, 'column_' . $column_name ), $item );
-
- echo $this->handle_row_actions( $item, $column_name, $primary );
- echo "</td>";
- } else {
- echo "<td $attributes>";
-
- $this->column_default( $item, $column_name );
-
- echo $this->handle_row_actions( $item, $column_name, $primary );
- echo "</td>";
- }
- }
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function display_rows() {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $this->items as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $class = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,28 +395,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row actions output for users in Multisite.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $user, $column_name, $primary ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $super_admins = get_super_admins();
</span><span class="cx" style="display: block; padding: 0 10px"> $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
</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 ( $primary === $column_name ) {
- $actions = array();
- $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
</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 ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
- $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
+ $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Filter the action links displayed under each user in the Network Admin Users list table.
- *
- * @since 3.2.0
- *
- * @param array $actions An array of action links to be displayed.
- * Default 'Edit', 'Delete'.
- * @param WP_User $user WP_User object.
- */
- $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
- return $this->row_actions( $actions );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filter the action links displayed under each user in the Network Admin Users list table.
+ *
+ * @since 3.2.0
+ *
+ * @param array $actions An array of action links to be displayed.
+ * Default 'Edit', 'Delete'.
+ * @param WP_User $user WP_User object.
+ */
+ $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
+ return $this->row_actions( $actions );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswppostslisttablephp"></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-posts-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-posts-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-posts-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -698,6 +698,22 @@
</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
+ * @access protected
+ *
+ * @param WP_Post $post
+ * @param string $classes
+ * @param string $data
+ * @param string $primary
+ */
+ protected function _column_title( $post, $classes, $data, $primary ) {
+ echo '<td class="' . $classes . ' page-title" ', $data, '>';
+ echo $this->column_title( $post );
+ echo $this->handle_row_actions( $post, 'title', $primary );
+ echo '</td>';
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Handles the title column output.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -973,58 +989,6 @@
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Handles columns output for a single row in the table.
- *
- * @since 4.3.0
- * @access public
- *
- * @param WP_Post $item The current WP_Post object.
- */
- public function single_row_columns( $item ) {
- 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';
- }
-
- if ( 'title' === $column_name ) {
- $classes .= ' page-title'; // Special addition for title column
- }
-
- if ( in_array( $column_name, $hidden ) ) {
- $classes .= ' hidden';
- }
-
- // Comments column uses HTML in the display name with screen reader text.
- // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
- $data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
-
- $attributes = "class='$classes' $data";
-
- if ( 'cb' === $column_name ) {
- echo '<th scope="row" class="check-column">';
-
- $this->column_cb( $item );
-
- echo '</th>';
- } else {
- echo "<td $attributes>";
-
- if ( method_exists( $this, 'column_' . $column_name ) ) {
- call_user_func( array( $this, 'column_' . $column_name ), $item );
- } else {
- $this->column_default( $item, $column_name );
- }
-
- echo $this->handle_row_actions( $item, $column_name, $primary );
- echo '</td>';
- }
- }
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Post $post
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|WP_Post $post
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,74 +1048,75 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row actions output for posts.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $post, $column_name, $primary ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = _draft_or_post_title();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ 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">- if ( $primary === $column_name ) {
- $post_type_object = get_post_type_object( $post->post_type );
- $can_edit_post = current_user_can( 'edit_post', $post->ID );
- $actions = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_type_object = get_post_type_object( $post->post_type );
+ $can_edit_post = current_user_can( 'edit_post', $post->ID );
+ $actions = array();
</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 ( $can_edit_post && 'trash' != $post->post_status ) {
- $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick Edit' ) . '</a>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $can_edit_post && 'trash' != $post->post_status ) {
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick Edit' ) . '</a>';
+ }
</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 ( current_user_can( 'delete_post', $post->ID ) ) {
- if ( 'trash' == $post->post_status )
- $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
- elseif ( EMPTY_TRASH_DAYS )
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
- if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( 'trash' == $post->post_status )
+ $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
+ }
</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 ( $post_type_object->public ) {
- if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
- if ( $can_edit_post ) {
- $preview_link = set_url_scheme( get_permalink( $post->ID ) );
- /** This filter is documented in wp-admin/includes/meta-boxes.php */
- $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
- $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
- }
- } elseif ( 'trash' != $post->post_status ) {
- $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post_type_object->public ) {
+ $title = _draft_or_post_title();
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
+ if ( $can_edit_post ) {
+ $preview_link = set_url_scheme( get_permalink( $post->ID ) );
+ /** This filter is documented in wp-admin/includes/meta-boxes.php */
+ $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
+ $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 'trash' != $post->post_status ) {
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</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 ( is_post_type_hierarchical( $post->post_type ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_post_type_hierarchical( $post->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">- /**
- * Filter the array of row action links on the Pages list table.
- *
- * The filter is evaluated only for hierarchical post types.
- *
- * @since 2.8.0
- *
- * @param array $actions An array of row action links. Defaults are
- * 'Edit', 'Quick Edit', 'Restore, 'Trash',
- * 'Delete Permanently', 'Preview', and 'View'.
- * @param WP_Post $post The post object.
- */
- $actions = apply_filters( 'page_row_actions', $actions, $post );
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filter the array of row action links on the Pages list table.
+ *
+ * The filter is evaluated only for hierarchical post types.
+ *
+ * @since 2.8.0
+ *
+ * @param array $actions An array of row action links. Defaults are
+ * 'Edit', 'Quick Edit', 'Restore, 'Trash',
+ * 'Delete Permanently', 'Preview', and 'View'.
+ * @param WP_Post $post The post object.
+ */
+ $actions = apply_filters( 'page_row_actions', $actions, $post );
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Filter the array of row action links on the Posts list table.
- *
- * The filter is evaluated only for non-hierarchical post types.
- *
- * @since 2.8.0
- *
- * @param array $actions An array of row action links. Defaults are
- * 'Edit', 'Quick Edit', 'Restore, 'Trash',
- * 'Delete Permanently', 'Preview', and 'View'.
- * @param WP_Post $post The post object.
- */
- $actions = apply_filters( 'post_row_actions', $actions, $post );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filter the array of row action links on the Posts list table.
+ *
+ * The filter is evaluated only for non-hierarchical post types.
+ *
+ * @since 2.8.0
+ *
+ * @param array $actions An array of row action links. Defaults are
+ * 'Edit', 'Quick Edit', 'Restore, 'Trash',
+ * 'Delete Permanently', 'Preview', and 'View'.
+ * @param WP_Post $post The post object.
+ */
+ $actions = apply_filters( 'post_row_actions', $actions, $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">- return $this->row_actions( $actions );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->row_actions( $actions );
</ins><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></span></pre></div>
<a id="trunksrcwpadminincludesclasswptermslisttablephp"></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-terms-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-terms-list-table.php 2015-07-14 17:45:55 UTC (rev 33269)
+++ trunk/src/wp-admin/includes/class-wp-terms-list-table.php 2015-07-14 17:46:13 UTC (rev 33270)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,50 +396,52 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Row actions output for terms.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function handle_row_actions( $tag, $column_name, $primary ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = $this->screen->taxonomy;
</span><span class="cx" style="display: block; padding: 0 10px"> $tax = get_taxonomy( $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> $default_term = get_option( 'default_' . $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) );
</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 ( $primary === $column_name ) {
- $actions = array();
- if ( current_user_can( $tax->cap->edit_terms ) ) {
- $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';
- }
- if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
- $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";
- if ( $tax->public )
- $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions = array();
+ if ( current_user_can( $tax->cap->edit_terms ) ) {
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';
+ }
+ if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
+ $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";
+ if ( $tax->public )
+ $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Filter the action links displayed for each term in the Tags list table.
- *
- * @since 2.8.0
- * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
- *
- * @param array $actions An array of action links to be displayed. Default
- * 'Edit', 'Quick Edit', 'Delete', and 'View'.
- * @param object $tag Term object.
- */
- $actions = apply_filters( 'tag_row_actions', $actions, $tag );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filter the action links displayed for each term in the Tags list table.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
+ *
+ * @param array $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param object $tag Term object.
+ */
+ $actions = apply_filters( 'tag_row_actions', $actions, $tag );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Filter the action links displayed for each term in the terms list table.
- *
- * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
- *
- * @since 3.0.0
- *
- * @param array $actions An array of action links to be displayed. Default
- * 'Edit', 'Quick Edit', 'Delete', and 'View'.
- * @param object $tag Term object.
- */
- $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filter the action links displayed for each term in the terms list table.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param array $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param object $tag Term object.
+ */
+ $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->row_actions( $actions );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->row_actions( $actions );
</ins><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></span></pre>
</div>
</div>
</body>
</html>