Пример #1
0
/**
 * Less handler function for widgetimage function
 *
 * @param $url
 * @return string
 */
function origin_widgets_less_widgetimage($url)
{
    $the_url = '';
    foreach ($url[2] as $p) {
        if (is_string($p)) {
            $the_url .= $p;
        } elseif (is_array($p)) {
            $the_url .= $p[1];
        }
    }
    // Search for the appropriate image
    $return_url = '';
    foreach (SiteOrigin_Panels_Widget::get_image_folders() as $folder => $folder_url) {
        if (file_exists($folder . '/' . $the_url)) {
            $return_url = $folder_url . '/' . $the_url;
        }
    }
    if (is_ssl()) {
        $return_url = str_replace('http://', 'https://', $return_url);
    }
    return $return_url;
}
Пример #2
0
/**
 * Less handler function for widgetimage function
 *
 * @param $url
 * @return string
 */
function origin_widgets_less_widgetimage($url)
{
    $the_url = '';
    foreach ($url[2] as $p) {
        if (is_string($p)) {
            $the_url .= $p;
        } elseif (is_array($p)) {
            $the_url .= $p[1];
        }
    }
    // Search for the appropriate image
    foreach (SiteOrigin_Panels_Widget::get_image_folders() as $folder => $folder_url) {
        if (file_exists($folder . '/' . $the_url)) {
            return esc_url($folder_url . '/' . $the_url);
        }
    }
    return '';
}