Use row_actions() in WP_Plugins_Table. See #14579

git-svn-id: http://svn.automattic.com/wordpress/trunk@15924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-23 11:22:00 +00:00
parent 6fca3408b6
commit 10ec70d244
2 changed files with 7 additions and 8 deletions

View File

@ -3606,12 +3606,10 @@ class WP_Plugins_Table extends WP_List_Table {
<tr class='$class second'>
<td></td>
<td class='plugin-title'>";
echo '<div class="row-actions-visible">';
foreach ( $actions as $action => $link ) {
$sep = end( $actions ) == $link ? '' : ' | ';
echo "<span class='$action'>$link$sep</span>";
}
echo "</div></td>
echo $this->row_actions( $actions, true );
echo "</td>
<td class='desc'>";
$plugin_meta = array();
if ( !empty( $plugin_data['Version'] ) )

View File

@ -273,16 +273,17 @@ class WP_List_Table {
* @access protected
*
* @param array $actions The list of actions
* @param bool $always_visible Wether the actions should be always visible
* @return string
*/
function row_actions( $actions ) {
function row_actions( $actions, $always_visible = false ) {
$action_count = count( $actions );
$i = 0;
if ( !$action_count )
return '';
$out = '<div class="row-actions">';
$out = '<div class="' . ( $always_visible ? 'row-actions-visible' : 'row-actions' ) . '">';
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';