Ejemplo n.º 1
0
 public function parent()
 {
     if (!$this->parent && $this->post->parent()) {
         $this->parent = new TimberProxy($this->post->parent());
     }
     return $this->parent;
 }
Ejemplo n.º 2
0
 function testPostParent()
 {
     $parent_id = $this->factory->post->create();
     $child_id = $this->factory->post->create(array('post_parent' => $parent_id));
     $child_post = new TimberPost($child_id);
     $this->assertEquals($parent_id, $child_post->parent()->ID);
 }