$link_data
'
+ ),
+ '6.1.0'
+ );
+
+ return array( '' );
+ }
+
+ $views_links = array();
+
+ foreach ( $link_data as $view => $link ) {
+ if ( empty( $link['url'] ) || ! is_string( $link['url'] ) || '' === trim( $link['url'] ) ) {
+ _doing_it_wrong(
+ __METHOD__,
+ sprintf(
+ /* translators: %1$s: The argument name. %2$s: The view name. */
+ __( 'The %1$s argument must be a non-empty string for %2$s.' ),
+ 'url
',
+ '' . esc_html( $view ) . '
'
+ ),
+ '6.1.0'
+ );
+
+ continue;
+ }
+
+ if ( empty( $link['label'] ) || ! is_string( $link['label'] ) || '' === trim( $link['label'] ) ) {
+ _doing_it_wrong(
+ __METHOD__,
+ sprintf(
+ /* translators: %1$s: The argument name. %2$s: The view name. */
+ __( 'The %1$s argument must be a non-empty string for %2$s.' ),
+ 'label
',
+ '' . esc_html( $view ) . '
'
+ ),
+ '6.1.0'
+ );
+
+ continue;
+ }
+
+ $views_links[ $view ] = sprintf(
+ '%s',
+ esc_url( $link['url'] ),
+ isset( $link['current'] ) && true === $link['current'] ? ' class="current" aria-current="page"' : '',
+ $link['label']
+ );
+ }
+
+ return $views_links;
+ }
+
+ /**
* Gets the list of views available on this table.
*
* The format is an associative array:
@@ -458,7 +570,7 @@
*
* @since 3.1.0
*
- * @param string $which The location of the bulk actions: 'top' or 'bottom'.
+ * @param string $which The location of the bulk actions: Either 'top' or 'bottom'.
* This is designated as optional for backward compatibility.
*/
protected function bulk_actions( $which = '' ) {
@@ -487,7 +599,10 @@
return;
}
- echo '';
+ echo '';
echo '