Introduce WP_List_Table::row_actions(). See #14579

git-svn-id: http://svn.automattic.com/wordpress/trunk@15571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu
2010-09-05 16:53:59 +00:00
parent 7b26cd223f
commit f24da67b4b
2 changed files with 48 additions and 62 deletions

View File

@@ -215,6 +215,33 @@ class WP_List_Table {
echo "<input type='submit' value='" . esc_attr__( 'Apply' ) . "' name='doaction$two' id='doaction$two' class='button-secondary action' />\n";
}
/**
* Generate row actions div
*
* @since 3.1.0
* @access protected
*
* @param array $actions The list of actions
* @return string
*/
function row_actions( $actions ) {
$action_count = count( $actions );
$i = 0;
if ( !$action_count )
return '';
$out = '<div class="row-actions">';
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
$out .= "<span class='$action'>$link$sep</span>";
}
$out .= '</div>';
return $out;
}
/**
* Display a monthly dropdown for filtering items
*