public function __construct($regex = null) { parent::__construct($regex); add_filter('post_type_link', array($this, 'getPermalink'), 200, 3); }