Khalil Ghâñmî

0 %
Khalil Ghâñmî
Développeur full-stack
  • Residence:
    Tunis
  • City:
    Bardo
  • Age:
    28
French
English
arabe
HTML 5 / CSS 3
JavaScript / jquery
PHP / MYSQL
WordPress
OpenCart 3
Vegas Pro
Adobe premier pro
  • Bootstrap, Materialize
  • Stylus, Sass, Less

display id table user PHP in WordPress

24 August 2022
get_current_user_id()

Gets the current user’s ID.

Return

(int) The current user’s ID, or 0 if no user is logged in.

Top ↑

Source

File: wp-includes/user.php

function get_current_user_id() {
    if ( ! function_exists( 'wp_get_current_user' ) ) {
        return 0;
    }
    $user = wp_get_current_user();
    return ( isset( $user->ID ) ? (int) $user->ID : 0 );
}
Posted in Non classé, PHPTags:
Write a comment