library/Controller/BaseController.php
public function getSocialShareUrl()
    {
        //Get the post id
        if(!$postId = get_the_ID()) {
            global $post; 
            $postId = $post->ID; 
        }

        //Return share url
        return urlencode(get_home_url(null, '?socialShareId=' . $postId, null)); 
    }
public function getSocialShareUrl()
    {
        //Get the post id
        if(!$postId = get_the_ID()) {
            global $post; 
            $postId = $post->ID; 
        }

        //Return share url
        return urlencode(get_home_url(null, '?socialShareId=' . $postId, null)); 
    }
public function getSocialShareUrl ( ) { //Get the post id if ( ! $ postId = get_the_ID ( ) ) { global $ post ; $ postId = $ post -> ID ; } //Return share url return urlencode ( get_home_url ( null , '?socialShareId=' . $ postId , null ) ) ; }
Get the social share url
@return string
Get the social share url