* ====================================================================== */ /** * Metabox object * * @package AAM * @author Vasyl Martyniuk <*****@*****.**> */ class AAM_Core_Object_Metabox extends AAM_Core_Object {
/** * Constructor * * @param AAM_Core_Subject $subject * @param WP_Post|Int $post * * @return void * * @access public */ public function __construct(AAM_Core_Subject $subject, $post) { parent::__construct($subject); //make sure that we are dealing with WP_Post object if ($post instanceof WP_Post) { $this->setPost($post); } elseif (intval($post)) { $this->setPost(get_post($post)); } if ($this->getPost()) { $this->read(); } }
/** * Constructor * * @param AAM_Core_Subject $subject * * @return void * * @access public */ public function __construct(AAM_Core_Subject $subject) { parent::__construct($subject); $this->setOption($this->getSubject()->getCapabilities()); }