$statbird_group, 's' => $statbird_search, 'orderby' => $statbird_orderby, 'order' => $statbird_order, 'limit' => $statbird_per, 'offset' => ( $statbird_paged - 1 ) * $statbird_per, ) ); $statbird_pages = max( 1, (int) ceil( $statbird_result['total'] / $statbird_per ) ); $statbird_base = admin_url( 'admin.php?page=statbird-customers' ); $statbird_keep = array_filter( array( 'group' => $statbird_group, 's' => $statbird_search, 'orderby' => $statbird_orderby, 'order' => $statbird_order, ) ); /** * Sortable column header link. * * @param string $col Column key. * @param string $label Label. * @param string $base Base URL. * @param array $keep Current filters. * @param string $cur Current orderby. * @param string $dir Current direction. */ $statbird_sort = static function ( $col, $label, $base, $keep, $cur, $dir ) { $next = ( $cur === $col && 'desc' === $dir ) ? 'asc' : 'desc'; $url = add_query_arg( array_merge( $keep, array( 'orderby' => $col, 'order' => $next, ) ), $base ); $aria = $cur === $col ? ( 'desc' === $dir ? 'descending' : 'ascending' ) : 'none'; printf( '