_post = $post; } public function get_meta() { if ( empty( $this->_meta ) ) { $this->_meta = new Thrive_AB_Meta( $this->_post->ID ); } return $this->_meta; } /** * @param $meta Thrive_AB_Meta */ public function set_meta( $meta ) { $this->_meta = $meta; } public function __get( $key ) { $value = null; if ( method_exists( $this, $key ) ) { $value = call_user_func( array( $this, $key ) ); } elseif ( isset( $this->_post->$key ) ) { $value = $this->_post->$key; } elseif ( ( $meta = $this->get_meta()->get( $key ) ) !== null ) { $value = $meta; } return $value; } public function get_post() { return $this->_post; } }