public function __get($name) { global $wf; // for unknown properties switch the blog and access this property on WOOF $res = parent::__get($name); if (is_woof_silent($res)) { if (is_multisite()) { if (switch_to_blog( $this->id(), true )) { if (property_exists($wf, $name)) { $res = $wf->{$name}; } else { $res = $wf->__get($name); } restore_current_blog(); if (!is_woof_silent($res)) { return $res; } } } } return $res; }
public function __get($name) { if (isset($this->_meta[$name])) { return $this->_meta[$name]; } return parent::__get($name); }
public function __get($name) { $type = $this->type($name); if ($type->exists()) { return $type; } $singular = WOOF_Inflector::singularize($name); $type = $this->type($singular); if ($type->exists()) { return $type; } // next look for a taxonomy $tax = $this->taxonomy($name); if ($tax->exists()) { return $tax; } $tax = $this->taxonomy($singular); if ($tax->exists()) { return $tax; } // now try to call a method on the current wordpress object // this way, extension classes can work correctly without needing to call $wf->the. $obj = $this->object(); if (method_exists($obj, $name)) { return call_user_func( array($obj, $name) ); } return parent::__get($name); }
public function __get($name) { global $wf; // try to find a taxonomy whose plural name is this $name $singular = WOOF_Inflector::singularize($name); $tax = $wf->taxonomy($singular); if ($tax->exists()) { return $this->terms($singular); } return parent::__get($name); }