| Server IP : 104.21.21.239 / Your IP : 216.73.216.55 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7 System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/lifamfest/wp-content/plugins/wordpress-https/lib/Mvied/ |
Upload File : |
<?php
/**
* Model class for a WordPress theme or plugin.
*
* @author Mike Ems
* @package Mvied
*/
class Mvied_Model {
protected $_post;
public $ID;
public $name;
public function __construct( $id ) {
if ( ! isset($id) ) {
return $this;
}
$this->_post = get_post($id);
$this->ID = $this->_post->ID;
$this->name = $this->_post->post_title;
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( !isset($this->$property) ) {
$this->$property = get_post_meta($this->ID, $property, true);
}
}
}
public function __get( $property ) {
return get_post_meta($this->ID, $property, true);
}
public function getPost() {
return $this->_post;
}
public function load( $array = array() ) {
foreach($array as $key => $value) {
if ( property_exists($this, $key) ) {
$this->$key = $value;
}
}
}
public function save() {
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( strpos($property, '_') !== 0 ) {
update_post_meta($this->_post->ID, $property, $this->$property);
}
}
}
}