Advertisement
Guest User

Untitled

a guest
May 20th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. <?php
  2. function get_current_user_id() {
  3. if ( ! function_exists( 'wp_get_current_user' ) ) {
  4. return 0;
  5. }
  6. $user = wp_get_current_user();
  7. return ( isset( $user->ID ) ? (int) $user->ID : 0 );
  8. echo json_encode($user)."\n";
  9. }
  10.  
  11. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement