/** * Transform a Wordpress URL by looking up OriginalLink values in the database. * If no such transformation exists, the unmodified URL is returned. * * @param string $url Original URL from the site * @return string New URL */ static function transform_url($url) { if ($match = WordpressPage::get()->filter("OriginalLink", $url)->First()) { return $match->Link(); } if ($match = WordpressPost::get()->filter("OriginalLink", $url)->First()) { return $match->Link(); } return $url; }
protected function assignTemplate() { parent::assignTemplate(); $this->vars['isSingle'] = true; $this->vars['page_type'] .= ' blog single'; }