<?php

namespace GriffinForms\Frontend\Html\Forms\Fields\Traits;

trait VariableValues
{
    protected function getPageID()
    {
        return get_the_ID();
    }
    
    protected function getUserID()
    {
        return get_current_user_id();
    }
    
    protected function getPageTitle()
    {
        return get_the_title();
    }
    
    protected function getUserFirstName()
    {
        $user = wp_get_current_user();
        return $user->user_firstname;
    }
    
    protected function getUserLastName()
    {
        $user = wp_get_current_user();
        return $user->user_lastname;
    }
    
    protected function getUserEmail()
    {
        $user = wp_get_current_user();
        return $user->user_email;
    }
    
    protected function getUserWebsite()
    {
        $user = wp_get_current_user();
        return $user->user_url;
    }
    
    protected function getCurrentUrl()
    {
        $url = get_permalink();
        if ($url !== false) {
            return $url;
        }
    }
}