Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmcclure/1401425 to your computer and use it in GitHub Desktop.
Save davidmcclure/1401425 to your computer and use it in GitHub Desktop.
<?php
function timeline($fieldname, $options = array(), $timeline = null)
{
$timeline = $timeline || get_current_timeline();
try {
$text = strtolower($timeline->$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