Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: product bulk edit always changes to admin is fixed #403

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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