EModal_Model_Theme_Meta::__construct( $id = null )


Description Description


Source Source

File: includes/importer/easy-modal-v2/model/theme/meta.php

	public function __construct( $id = null ) {
		global $wpdb;
		$table_name = $wpdb->prefix . $this->_table_name;
		$class_name = strtolower( $this->_class_name );

		$this->_default_fields['theme_id'] = $id;
		$this->_data                       = apply_filters( "{$class_name}_fields", $this->_default_fields );
		if ( $id && is_numeric( $id ) ) {
			$row = $wpdb->get_row( "SELECT * FROM $table_name WHERE theme_id = $id ORDER BY id DESC LIMIT 1", ARRAY_A );
			if ( $row[ $this->_pk ] ) {
				$this->process_load( $row );
			}
		} else {
			$this->set_fields( apply_filters( "{$class_name}_defaults", array() ) );
		}

		return $this;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.