WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/05/2010 04:53:59 PM (9 years ago)
Author:
scribu
Message:

Introduce WP_List_Table::row_actions(). See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/list-table.php

    r15569 r15571  
    214214
    215215        echo "<input type='submit' value='" . esc_attr__( 'Apply' ) . "' name='doaction$two' id='doaction$two' class='button-secondary action' />\n";
     216    }
     217
     218    /**
     219     * Generate row actions div
     220     *
     221     * @since 3.1.0
     222     * @access protected
     223     *
     224     * @param array $actions The list of actions
     225     * @return string
     226     */
     227    function row_actions( $actions ) {
     228        $action_count = count( $actions );
     229        $i = 0;
     230
     231        if ( !$action_count )
     232            return '';
     233
     234        $out = '<div class="row-actions">';
     235        foreach ( $actions as $action => $link ) {
     236            ++$i;
     237            ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
     238            $out .= "<span class='$action'>$link$sep</span>";
     239        }
     240        $out .= '</div>';
     241
     242        return $out;
    216243    }
    217244
Note: See TracChangeset for help on using the changeset viewer.