Esempio n. 1
0
 public function addContentFilter()
 {
     if (!$this->isPostType('wpt_test')) {
         return $this;
     }
     $this->test = $this->createTest($this->wp->getQuery()->get_queried_object());
     $action = $this->getTestPassingAction();
     $isLive = self::ACTION_FILL_FORM == $action || $this->test->isFinal();
     if (!$isLive) {
         return $this->dieUnderConctruction();
     }
     $this->registerScripts()->wp->addFilter('body_class', array($this, 'addPassingActionCssClass'));
     $this->createActionProcessor($action)->beforeRender($this->test, $this->passing);
     $this->enqueueStyle('public');
     $this->wp->addFilter('the_content', array($this, 'renderTestContent'));
     return $this;
 }