WP_List_Table::view_switcher( string $current_mode )
Display a view switcher
Parameters
- $current_mode
-
(Required)
Source
File: wp-admin/includes/class-wp-list-table.php
protected function view_switcher( $current_mode ) {
?>
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
<div class="view-switch">
<?php
foreach ( $this->modes as $mode => $title ) {
$classes = array( 'view-' . $mode );
if ( $current_mode === $mode )
$classes[] = 'current';
printf(
"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
esc_url( add_query_arg( 'mode', $mode ) ),
implode( ' ', $classes ),
$title
);
}
?>
</div>
<?php
}
Changelog
Version | Description |
---|---|
WP-3.1.0 | Introduced. |