Use row_actions() in WP_Plugins_Table. See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@15924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3081a12de2
commit
2146585c80
|
@ -3606,12 +3606,10 @@ class WP_Plugins_Table extends WP_List_Table {
|
||||||
<tr class='$class second'>
|
<tr class='$class second'>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class='plugin-title'>";
|
<td class='plugin-title'>";
|
||||||
echo '<div class="row-actions-visible">';
|
|
||||||
foreach ( $actions as $action => $link ) {
|
echo $this->row_actions( $actions, true );
|
||||||
$sep = end( $actions ) == $link ? '' : ' | ';
|
|
||||||
echo "<span class='$action'>$link$sep</span>";
|
echo "</td>
|
||||||
}
|
|
||||||
echo "</div></td>
|
|
||||||
<td class='desc'>";
|
<td class='desc'>";
|
||||||
$plugin_meta = array();
|
$plugin_meta = array();
|
||||||
if ( !empty( $plugin_data['Version'] ) )
|
if ( !empty( $plugin_data['Version'] ) )
|
||||||
|
|
|
@ -273,16 +273,17 @@ class WP_List_Table {
|
||||||
* @access protected
|
* @access protected
|
||||||
*
|
*
|
||||||
* @param array $actions The list of actions
|
* @param array $actions The list of actions
|
||||||
|
* @param bool $always_visible Wether the actions should be always visible
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function row_actions( $actions ) {
|
function row_actions( $actions, $always_visible = false ) {
|
||||||
$action_count = count( $actions );
|
$action_count = count( $actions );
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ( !$action_count )
|
if ( !$action_count )
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$out = '<div class="row-actions">';
|
$out = '<div class="' . ( $always_visible ? 'row-actions-visible' : 'row-actions' ) . '">';
|
||||||
foreach ( $actions as $action => $link ) {
|
foreach ( $actions as $action => $link ) {
|
||||||
++$i;
|
++$i;
|
||||||
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
||||||
|
|
Loading…
Reference in New Issue