Title: CSV Download
Author: desie314
Published: <strong>2016년 8월 2일</strong>
Last modified: 2016년 8월 2일

---

플러그인 검색

이 플러그인은 **최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다**. 워드프레스의
좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 
있을 수 있습니다.

![](https://s.w.org/plugins/geopattern-icon/csv-download.svg)

# CSV Download

 작성자: [desie314](https://profiles.wordpress.org/desie314/)

[다운로드](https://downloads.wordpress.org/plugin/csv-download.zip)

 * [세부사항](https://ko.wordpress.org/plugins/csv-download/#description)
 * [평가](https://ko.wordpress.org/plugins/csv-download/#reviews)
 *  [설치](https://ko.wordpress.org/plugins/csv-download/#installation)
 * [개발](https://ko.wordpress.org/plugins/csv-download/#developers)

 [지원](https://wordpress.org/support/plugin/csv-download/)

## 설명

A plugin for WP developers to easily add CSV download links to the admin section
or front end. When a specific GET variable is detected (from the download link) 
your data, which needs to be a multi-dimensional array, is passed to a function 
that converts it to a csv file and triggers the download.

Add the following code to **functions.php**.

#### Admin Example

    ```
    /**
     * Instantiate CSVDownload class with appropriate arguments (listed in class).
     * Arguments are optional
     */
    if (class_exists('CSVDownload')) {
      $csv_button = New CSVDownload(array(
        'post_types' => array('page'),
        'post_type_ids' => array(420, 114, 749),
        'metabox_title' => 'Download CSV Data',
        'help_text' => 'CSV file containing useful data.',
        'parameter' => 'csv_export_button',
        'button_text' => 'Download'
      ));
    }

    /**
     * Get results, convert to csv file, and trigger download.
     */
    if(isset($_GET[$csv_button->parameter])) {
      add_action('admin_init', function(){
        // Get results array
        $results = get_csv_file_results();
        // Convert results array to csv file and trigger download.
        CSVDownload::download_csv_results(array(
          'results' => $results,
          'file_name' => 'csv_data'
        ));
        exit;
      }, 1);
    }

    /**
     * Get the results array for the csv button download.
     *
     * @return array
     */
    function get_csv_file_results(){

      // Create multi-dimensional array.
      $results_array = array(
        array('Email','User Name','Favorite Color'), // Column headers
        array('fake@email.com','coolguy1','blue'),
        array('fake@email.com','coolguy2','orange'),
        array('fake@email.com','coolguy3','pink'),
        array('fake@email.com','coolguy4','red'),
      );

      // Return results array
      return $results_array;
    }
    ```

#### Front End Example

Add a button element to your HTML.

    ```
    <a href="<?php echo $_SERVER["REQUEST_URI"]; ?>?csv_export_button=1">Download</a>
    ```

Add init action callback and provide array data.

    ```
    /**
     * Get results, convert to csv file, and trigger download.
     */
    if(isset($_GET['csv_export_button'])) {
      add_action('init', function(){
        // Get results array
        $results = get_csv_file_results();
        // Convert results array to csv file and trigger download.
        CSVDownload::download_csv_results(array(
          'results' => $results,
          'file_name' => 'csv_data'
        ));
        exit;
      }, 1);
    }

    /**
     * Get the results array for the csv button download.
     *
     * @return array
     */
    function get_csv_file_results(){

      // Create multi-dimensional array.
      $results_array = array(
        array('Email','User Name','Favorite Color'), // Column headers
        array('fake@email.com','coolguy1','blue'),
        array('fake@email.com','coolguy2','orange'),
        array('fake@email.com','coolguy3','pink'),
        array('fake@email.com','coolguy4','red'),
      );

      // Return results array
      return $results_array;
    }
    ```

[AgencyLabs.com](http://agencylabs.com/) – A digital production studio.

## 스크린샷

[⌊Admin section example metabox.⌉⌊Admin section example metabox.⌉[

Admin section example metabox.

## 설치

 1. Upload the plugin files to the `/wp-content/plugins/csv-download` directory, or
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## 후기

![](https://secure.gravatar.com/avatar/9155e309b408a49e4935180198cf8ac5f6fbae6576b4b60cab34d230a81bad57?
s=60&d=retro&r=g)

### 󠀁[Heck I use it.](https://wordpress.org/support/topic/heck-i-use-it/)󠁿

 [desie314](https://profiles.wordpress.org/desie314/) 2016년 9월 3일

No complaints so far.

 [ 모든 1 평가 읽기 ](https://wordpress.org/support/plugin/csv-download/reviews/)

## 기여자 & 개발자

“CSV Download”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

 *   [ desie314 ](https://profiles.wordpress.org/desie314/)

[자국어로 “CSV Download”(을)를 번역하세요.](https://translate.wordpress.org/projects/wp-plugins/csv-download)

### 개발에 관심이 있으십니까?

[코드 탐색하기](https://plugins.trac.wordpress.org/browser/csv-download/)는, [SVN 저장소](https://plugins.svn.wordpress.org/csv-download/)
를 확인하시거나, [개발 기록](https://plugins.trac.wordpress.org/log/csv-download/)
을 [RSS](https://plugins.trac.wordpress.org/log/csv-download/?limit=100&mode=stop_on_copy&format=rss)
로 구독하세요.

## 기초

 *  버전 **1.0.0**
 *  최근 업데이트: **10년 전**
 *  활성화된 설치 **10+**
 *  다음까지 시험됨: **4.5.33**
 *  언어
 * [English (US)](https://wordpress.org/plugins/csv-download/)
 * 태그:
 * [csv](https://ko.wordpress.org/plugins/tags/csv/)
 *  [고급 보기](https://ko.wordpress.org/plugins/csv-download/advanced/)

## 평점

 별 5점 만점에 5점.

 *  [  1/5-별점 후기     ](https://wordpress.org/support/plugin/csv-download/reviews/?filter=5)
 *  [  0/4-별점 후기     ](https://wordpress.org/support/plugin/csv-download/reviews/?filter=4)
 *  [  0/3-별점 후기     ](https://wordpress.org/support/plugin/csv-download/reviews/?filter=3)
 *  [  0/2-별점 후기     ](https://wordpress.org/support/plugin/csv-download/reviews/?filter=2)
 *  [  0/1-별점 후기     ](https://wordpress.org/support/plugin/csv-download/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/csv-download/reviews/#new-post)

[모든  리뷰 보기](https://wordpress.org/support/plugin/csv-download/reviews/)

## 기여자

 *   [ desie314 ](https://profiles.wordpress.org/desie314/)

## 지원

할 말 있으신가요? 도움이 필요하신가요?

 [지원 포럼 보기](https://wordpress.org/support/plugin/csv-download/)