Esempio n. 1
0
  function __get($name) {

    // is we're accessing the set named "content" and it exists, prioritise this first
    // this allows us to call "content()" to get the standard content FIELD.
    
    if ($name == "content") {
      $set = $this->set("content");
      
      if ($set->exists()) {
        return $set;
      }
    }

    if ($name == "posts" || $name == "pages") {
      return parent::__get($name);
    }
    
    // first, look for a property named $name
    $result = $this->get($name);
    
    if (!is_woof_silent($result)) {
      return $result;
    }    
    
    // next, try to get a set named $name
    $result = $this->s($name);
    
    if (!is_woof_silent($result)) {
      return $result;
    }    

    // next try the parent, which will get post types, or taxonomies with this name
    return parent::__get($name);
    
  }