This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Allow admins to manually enter new WooCommerce orders from the frontend checkout field. | |
// Hook the woocommerce_checkout_customer_id filter found in the WC_Checkout class. | |
add_filter( 'woocommerce_checkout_customer_id', 'change_current_user_id_to_new_user' ); | |
function change_current_user_id_to_new_user( $user_id ) { | |
//Check if logged in user is admin. | |
if ( current_user_can( 'manage_options' ) ) { |