wp_strip_all_tags( __( 'Name' ) ), 'created' => wp_strip_all_tags( __( 'Created' ) ), 'last_used' => wp_strip_all_tags( __( 'Last Used' ) ), 'last_ip' => wp_strip_all_tags( __( 'Last IP' ) ), 'revoke' => wp_strip_all_tags( __( 'Revoke' ) ), ); } /** * Prepares the list of items for displaying. * * @since 0.1-dev */ public function prepare_items() { $columns = $this->get_columns(); $hidden = array(); $sortable = array(); $primary = 'name'; $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); } /** * Generates content for a single row of the table * * @since 0.1-dev * @access protected * * @param object $item The current item. * @param string $column_name The current column name. */ protected function column_default( $item, $column_name ) { switch ( $column_name ) { case 'name': return esc_html( $item['name'] ); case 'created': if ( empty( $item['created'] ) ) { return '—'; } return date( get_option( 'date_format', 'r' ), $item['created'] ); case 'last_used': if ( empty( $item['last_used'] ) ) { return '—'; } return date( get_option( 'date_format', 'r' ), $item['last_used'] ); case 'last_ip': if ( empty( $item['last_ip'] ) ) { return '—'; } return $item['last_ip']; case 'revoke': return get_submit_button( __( 'Revoke' ), 'delete', 'revoke-application-password', false ); default: return 'WTF^^?'; } } /** * Generates custom table navigation to prevent conflicting nonces. * * @since 0.1-dev * @access protected * * @param string $which The location of the bulk actions: 'top' or 'bottom'. */ protected function display_tablenav( $which ) { ?>