Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. //Admin JS
  2. add_action('admin_enqueue_scripts', 'admin_hooks');
  3. function admin_hooks( $hook ) {
  4.  
  5. global $woocommerce, $post;
  6. $order = new WC_Order($post->ID);
  7. //to escape # from order id
  8. $order_id = trim(str_replace('#', '', $order->get_order_number()));
  9. $user_id = $order->user_id;
  10. $user_info = get_userdata($user_id);
  11.  
  12.  
  13. wp_enqueue_script( 'admin-hooks', get_template_directory_uri(). '/js/admin.hook.js' );
  14. wp_localize_script( 'admin-hooks', 'myTest', $user_info->roles );
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement