WordPress.org

Ready to get started?Download WordPress

Forums

WP Ultimate CSV Importer Plugin
[resolved] Empty featured images fields are imported (2 posts)

  1. Ian Dunn
    Member
    Posted 1 year ago #

    The plugin tries to import empty values in the featured_image CSV field, and creates entries in the Media Library for them. I fixed this with the following modifications to upload_csv_file():

    if(is_dir($full_path)){
    	$fileCopy = copy($file_url,$filepath);
    }
    else{
    	wp_mkdir_p($full_path);
    	$fileCopy = copy($file_url,$filepath);
    }

    and

    if( $fileCopy )
    {
    	$file['guid']=$fileurl;
    	$file['post_title']=$img_title;
    	$file['post_content']='';
    	$file['post_status']='inherit';
    }
    else
    	$file = false;

    so that the if(!empty($file)){ condition later in the function fails and wp_insert_attachment() is never called.

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

  2. smackcoders
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your feedback. we will look into this and will update in next version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.