Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Prevent vendor / admin / creator bidding on their own auctions
- This code snippet should go to your child theme functions.php file.
- */
- add_filter( 'woocommerce_simple_auctions_before_place_bid_filter' , 'wsa_check_creator', 1);
- function wsa_check_creator($product_data) {
- $post1 = get_post( $product_data->id );
- if ( get_current_user_id() == $post1->post_author ){
- wc_add_notice( esc_html__( 'You cannot bid on your own auctions.', 'your_custom_translation'), 'error' );
- return FALSE;
- } else {
- // user can place a bid
- return TRUE;
- }
- }
Add Comment
Please, Sign In to add comment