AnsPress_Profile_Hooks::current_user_id()

Description #

Get current user id for AnsPress profile.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: addons/free/profile.php

451
452
453
454
455
456
457
458
459
460
461
public static function current_user_id() {
    $query_object = get_queried_object();
    $user_id = get_queried_object_id();
 
    // Current user id if queried object is not set.
    if ( ! $query_object instanceof WP_User || empty( $user_id ) ) {
        $user_id = get_current_user_id();
    }
 
    return (int) $user_id;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment