WP CSV Exporter – WordPress Plugin

WP CSV Exporter – WordPress Plugin

Author: Nakashima Masahiro

Author Profile: kanakogi

Version: 1.3.4

WordPress Version: 3.0 or higher

(Downloads - 4)

Category:

Description

 

WP CSV Exporter – WordPress Plugin

You can export posts in CSV format for each post type.
It is compatible with posts’ custom fields and custom taxonomies.
It is also possible to set the number or date range of posts to download.

HOW TO CUSTOMIZE EXPORT POST DATA

This plugin has below filters.

  • wp_csv_exporter_post_name
  • wp_csv_exporter_post_title
  • wp_csv_exporter_post_content
  • wp_csv_exporter_post_excerpt
  • wp_csv_exporter_post_status
  • wp_csv_exporter_post_author
  • wp_csv_exporter_post_date
  • wp_csv_exporter_post_modified
  • wp_csv_exporter_thumbnail_url
  • wp_csv_exporter_post_tags
  • wp_csv_exporter_post_category
  • wp_csv_exporter_tax_{taxonomy}
  • wp_csv_exporter_{custom_field_key}

WP_CSV_EXPORTER_POST_NAME

Parameters:

  • $post_name – (required) post slug
  • $post_id – (int) post id

Example:

add_filter( 'wp_csv_exporter_post_name', 'wp_csv_exporter_post_name_filter', 10, 3 );
function wp_csv_exporter_post_name_filter( $post_name, $post_id  ) {
    return $post_name;
}

WP_CSV_EXPORTER_POST_TITLE

Parameters:

  • $post_title – (required) post title
  • $post_id – (int) post id

Example:

add_filter( 'wp_csv_exporter_post_title', 'wp_csv_exporter_post_title_filter', 10, 3 );
function wp_csv_exporter_post_title_filter( $post_title, $post_id  ) {
    $post_title = $post_id . ':' . $post_title;
    return $post_title;
}

WP_CSV_EXPORTER_POST_CONTENT

Parameters:

  • $post_content – (required) post content
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_EXCERPT

Parameters:

  • $post_excerpt – (required) post excerpt
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_STATUS

Parameters:

  • $post_status – (required) post status
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_AUTHOR

Parameters:

  • $post_author – (required) post author
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_DATE

Parameters:

  • $post_date – (required) post date
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_MODIFIED

Parameters:

  • $post_modified – (required) post modified date
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_THUMBNAIL_URL

Parameters:

  • $post_thumbnail_url – (required) post thumbnail_url
  • $post_id – (int) post id

WP_CSV_EXPORTER_POST_TAGS

Parameters:

  • $post_tags – (array)(required) post tags
  • $post_id – (int) post id

Example:

add_filter( 'wp_csv_exporter_post_tags', 'wp_csv_exporter_post_tags_filter', 10, 3 );
function wp_csv_exporter_post_tags_filter( $post_tags, $post_id  ) {
    $_post_tags = array();
    foreach ( $post_tags as $key => $tag ) {
        $_post_tags[] = 'Tag:'.$tag;
    }
    return $_post_tags;
}

WP_CSV_EXPORTER_CATEGORY

Parameters:

  • $category – (array)(required) post category
  • $post_id – (int) post id

Example:

add_filter( 'wp_csv_exporter_category', 'wp_csv_exporter_category_filter', 10, 3 );
function wp_csv_exporter_post_category_filter( $category, $post_id  ) {
    $_category = array();
    foreach ( $category as $key => $value ) {
        $_category[] = 'Category:'.$value;
    }
    return $_category;
}

WP_CSV_EXPORTER_TAX_{TAXONOMY}

Parameters:

  • $term_values – (array)(required) post taxonomy
  • $post_id – (int) post id

Example: taxonomy = “dogs”

add_filter( 'wp_csv_exporter_tax_dogs', 'wp_csv_exporter_tax_dogs_filter', 10, 3 );
function wp_csv_exporter_tax_dogs_filter( $term_values, $post_id ) {
    $_term_values = array();
    foreach ( $term_values as $key => $term_value ) {
        $_term_values[] = 'Dog:'.$term_value;
    }
    return $_term_values;
}

WP_CSV_EXPORTER_{CUSTOM_FIELD_KEY}

Parameters:

  • $field – (required) post custom field
  • $post_id – (int) post id

Example: custom field key = “price”

add_filter( 'wp_csv_exporter_price', 'wp_csv_exporter_price_filter', 10, 3 );
function wp_csv_exporter_price_filter( $field, $post_id ) {
    return 'Price:'.$field;
}

Contributors & Developers

“WP CSV Exporter” is open source software. The following people have contributed to this plugin.

Support: https://wordpress.org/support/plugin/wp-csv-exporter/

Download More WordPress Plugin Click Here.