Skip to content

Instantly share code, notes, and snippets.

@waynegraham
Created November 28, 2011 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save waynegraham/1401407 to your computer and use it in GitHub Desktop.
Save waynegraham/1401407 to your computer and use it in GitHub Desktop.
<?php
function timeline($fieldname, $options = array(), $timeline = null)
{
$timeline = $timeline || get_current_timeline();
try {
$text = $timeline->strtolower($fieldname);
} catch (Exception $e) {
'"' . $fieldName . '"" does not exist for timelines!';
}
if(isset($options['snippet'])) {
$text = snippet($text, 0, (int)$options['snippet']);
}
if($fieldname === "url") {
$text = abs_timeline_uri($text);
}
return $text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment