Changeset 356911
- Timestamp:
- 03/07/2011 08:56:45 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-e-commerce/branches/3.8-development/wpsc-admin/includes/settings-pages/import.php
r354003 r356911 112 112 $value_data = $_POST['value_name']; 113 113 114 if ($_POST['post_status'] == 'publish') 115 $status = '1'; 116 114 $status = esc_attr($_POST['post_status']); 115 117 116 $name = array( ); 118 117 foreach ( $value_data as $key => $value ) { … … 140 139 'display_frontpage' => null, 141 140 'notax' => null, 142 'publish' => esc_attr( $status ),143 141 'active' => null, 144 142 'donation' => null, … … 146 144 'thumbnail_image' => null, 147 145 'thumbnail_state' => null, 148 'category' => array(149 esc_html__( $_POST['category'] )150 151 ),152 146 'meta' => array( 153 147 '_wpsc_price' => esc_attr( str_replace( '$', '', $cvs_data2['price'][$i] ) ), … … 162 156 ); 163 157 $product_columns = wpsc_sanitise_product_forms( $product_columns ); 164 wpsc_insert_product( $product_columns ); 158 // status needs to be set here because wpsc_sanitise_product_forms overwrites it :/ 159 $product_columns['post_status'] = $status; 160 $product_id = wpsc_insert_product( $product_columns ); 161 wp_set_object_terms( $product_id , array( (int)$_POST['category'] ) , 'wpsc_product_category' ); 165 162 } 166 163 echo "<br /><br />". sprintf(__("Success, your <a href='%s'>products</a> have been upload.", "wpsc"), admin_url('edit.php?post_type=wpsc-product'));
Note: See TracChangeset
for help on using the changeset viewer.