Skip to content

Commit

Permalink
fix: product bulk edit always changes to admin is fixed (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonh3 authored and sabbir1991 committed Oct 11, 2018
1 parent 2a9e0d0 commit 88bf3e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/wc-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ function dokan_author_field_quick_edit() {
<?php if ( ! $sellers ): ?>
<option value="<?php echo $admin_user->ID ?>"><?php echo $admin_user->display_name; ?></option>
<?php else: ?>
<option value=""><?php _e( '— No change —', 'dokan-lite' ); ?></option>
<option value="<?php echo $admin_user->ID; ?>"><?php echo $admin_user->display_name; ?></option>
<?php foreach ( $sellers as $key => $user): ?>
<option value="<?php echo $user->ID ?>"><?php echo $user->display_name; ?></option>
Expand Down Expand Up @@ -215,6 +216,11 @@ function dokan_save_quick_edit_vendor_data ( $product ) {

if ( isset( $_REQUEST['dokan_product_author_override'] ) ) {
$vendor_id = esc_attr( $_REQUEST['dokan_product_author_override'] );

if ( ! $vendor_id ) {
return;
}

wp_update_post( array( 'ID' => $product->get_id(), 'post_author' => $vendor_id ) );
}
}
Expand Down

0 comments on commit 88bf3e0

Please sign in to comment.