Timber\Integrations\CoAuthorsPlus::get_user_uid PHP Метод

get_user_uid() защищенный Метод

return the user id for normal authors the user login for guest authors if it exists and self::prefer_users == true or null
protected get_user_uid ( object $cauthor ) : integer | string | null
$cauthor object
Результат integer | string | null
    protected function get_user_uid($cauthor)
    {
        // if is guest author
        if (is_object($cauthor) && isset($cauthor->type) && $cauthor->type == 'guest-author') {
            // if have have a linked user account
            global $coauthors_plus;
            if (!$coauthors_plus->force_guest_authors && isset($cauthor->linked_account) && !empty($cauthor->linked_account)) {
                return $cauthor->linked_account;
            } else {
                return null;
            }
        } else {
            return $cauthor->id;
        }
    }