WordPress.org

Support

Support » Plugins and Hacks » CSV Import for WordPress » [Resolved] Empty featured images fields are imported

[Resolved] Empty featured images fields are imported

  • 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/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Empty featured images fields are imported’ is closed to new replies.
Skip to toolbar