Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Admin JS
- add_action('admin_enqueue_scripts', 'admin_hooks');
- function admin_hooks( $hook ) {
- global $woocommerce, $post;
- $order = new WC_Order($post->ID);
- //to escape # from order id
- $order_id = trim(str_replace('#', '', $order->get_order_number()));
- $user_id = $order->user_id;
- $user_info = get_userdata($user_id);
- wp_enqueue_script( 'admin-hooks', get_template_directory_uri(). '/js/admin.hook.js' );
- wp_localize_script( 'admin-hooks', 'myTest', $user_info->roles );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement