예제 #1
0
파일: output.php 프로젝트: socialweb/PiGo
/**
 * When given a title, returns a version suitable for inclusion in a URL
 *
 * @param string $title The title
 *
 * @return string The optimised title
 * @since 1.7.2
 */
function elgg_get_friendly_title($title)
{
    // return a URL friendly title to short circuit normal title formatting
    $params = array('title' => $title);
    $result = elgg_trigger_plugin_hook('format', 'friendly:title', $params, NULL);
    if ($result) {
        return $result;
    }
    // titles are often stored HTML encoded
    $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
    $title = ElggTranslit::urlize($title);
    return $title;
}
예제 #2
0
파일: output.php 프로젝트: nogsus/Elgg
/**
 * When given a title, returns a version suitable for inclusion in a URL
 *
 * @param string $title The title
 *
 * @return string The optimised title
 * @since 1.7.2
 */
function elgg_get_friendly_title($title)
{
    // return a URL friendly title to short circuit normal title formatting
    $params = array('title' => $title);
    $result = elgg_trigger_plugin_hook('format', 'friendly:title', $params, NULL);
    if ($result) {
        return $result;
    }
    // handle some special cases
    $title = str_replace('&', 'and', $title);
    $title = ElggTranslit::urlize($title);
    return $title;
}