Gdn_Upload::urls PHP Method

urls() public static method

If there is a plugin that wants to store uploads at a different location or in a different way then they register themselves by subscribing to the Gdn_Upload_GetUrls_Handler event. After that they will be available here.
public static urls ( string $Type = null ) : string
$Type string The type of upload to get the prefix for.
return string The url prefix.
    public static function urls($Type = null)
    {
        static $Urls = null;
        if ($Urls === null) {
            $Urls = array('' => asset('/uploads', true));
            $Sender = new stdClass();
            $Sender->Returns = array();
            $Sender->EventArguments = array();
            $Sender->EventArguments['Urls'] =& $Urls;
            Gdn::pluginManager()->callEventHandlers($Sender, 'Gdn_Upload', 'GetUrls');
        }
        if ($Type === null) {
            return $Urls;
        }
        if (isset($Urls[$Type])) {
            return $Urls[$Type];
        }
        return false;
    }