EModal_Model_Modal_Meta::save()


Description Description


Source Source

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

	public function save() {
		global $wpdb;
		$table_name = $wpdb->prefix . $this->_table_name;

		$rows = $wpdb->get_col( "SELECT id FROM $table_name WHERE modal_id = $this->modal_id ORDER BY id DESC" );
		if ( count( $rows ) ) {
			$this->id = $rows[0];
			$wpdb->update( $table_name, $this->serialized_values(), array( 'id' => $this->id ) );
		} else {
			$wpdb->insert( $table_name, $this->serialized_values() );
			$this->id = $wpdb->insert_id;
		}
	}

Top ↑

User Contributed Notes User Contributed Notes

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