How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

Look at this code

public function column_default( $item, $column_name ) {
    switch ( $column_name ) {
        case 'address':
        case 'city':
            return $item[ $column_name ];
        default:
            return print_r( $item, true ); //Show the whole array for....
    }
}

Since you are only trying to render user_id , browser and ip_address and those are not available in the switch case which defaults to default case and default case prints the whole array of the item like this( return print_r( $item, true ); )

Leave a Comment