Skip to content

Commit

Permalink
Make Page::isPublic hookable per @niklaka feature request issue #345
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancramerdesign committed Feb 8, 2014
1 parent 4dd403e commit d776986
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wire/core/Page.php
Expand Up @@ -1418,6 +1418,16 @@ public function isTrash() {
*
*/
public function isPublic() {
return self::isHooked('Page::isPublic()') ? $this->__call('isPublic', array()) : $this->___isPublic();
}

/**
* Implementation for the above isPublic function
*
* @return bool
*
*/
protected function ___isPublic() {
if($this->status >= Page::statusUnpublished) return false;
$template = $this->getAccessTemplate();
if(!$template || !$template->hasRole('guest')) return false;
Expand Down

0 comments on commit d776986

Please sign in to comment.