WordPress.org

Ready to get started?Download WordPress

Forums

CSV Importer
Category description (5 posts)

  1. Ruriko
    Member
    Posted 3 years ago #

    Is there a way to import category description?

    http://wordpress.org/extend/plugins/csv-importer/

  2. dvkob
    Member
    Plugin Author

    Posted 3 years ago #

    Ruriko: Not yet, but it will be trivial to add. I'll try to update the plugin soon.

  3. pekarna12
    Member
    Posted 3 years ago #

    Has this been added yet?

  4. dvkob
    Member
    Plugin Author

    Posted 3 years ago #

    pekarna12: Not yet. Other things keep getting in the way :)

  5. tzeldin88
    Member
    Posted 2 years ago #

    I wanted to import Descriptions for each Term of a Custom Taxonomy. Here is what I did. Hope it helps someone.

    Using CSV Importer plugin Version 0.3.5.

    In my CSV file, add the Description content after the Category name, separated by an arbitrary delimited "::", so it looks like this:

    csv_post_title,csv_post_type,csv_ctax_my-custom-taxonomy
    import-title,my-post-type,"MY PARENT CAT::My parent-cat description,MY CHILD SUBCAT 1::My sub-cat1 description"
    import-title,my-post-type,"MY PARENT CAT::My parent-cat description,MY CHILD SUBCAT 2::My sub-cat2 description"

    (note: it's probably not ideal/necessary to have the parent category description more than once, but I didn't test without it.)

    EDIT MY csv_importer.php FILE
    (Yes, this is hacking the plugin code, so my changes will be lost in any future updates of the plugin, and will require them to be implemented again.)

    Find line 362
    if ($parent) {
    after that, add

    $tz_parent_array = explode("::",$parent);
    $parent_desc = $tz_parent_array[1];
    $parent = $tz_parent_array[0];

    Change (what was) line 366 from
    $parent_info = wp_insert_term($parent, $taxonomy);
    to
    $parent_info = wp_insert_term($parent, $taxonomy, array('description' => $parent_desc));

    Find
    if ($parent_ok) {
    after that, add

    $tz_child_array = explode("::",$child);
    $child_desc = $tz_child_array[1];
    $child = $tz_child_array[0];

    Change
    array('parent' => $parent_id));
    to

    array(
    	'parent' => $parent_id,
    	'description' => $child_desc
    ));

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic