MP_Addon_Calendar::set( array $data )
Set Data to Database.
Contents
Parameters Parameters
- $data
-
(array) (Required) data
Return Return
(false|int)
Source Source
File: calculator-calendar-add-on/inc/MP_Addon_Calendar.php
public function set( $data ) {
global $wpdb;
$calendar_table = $wpdb->prefix . MortgagePlatform::$prefix . 'calendar';
$insert_data = array(
'id_post' => $data['id_post'],
'date' => gmdate( 'Y-m-d H:i:s', strtotime( $data['date'] ) ),
'title' => $data['title'],
'description' => $data['description'],
'type' => $data['type'],
'color' => $data['color'],
);
$insert = $wpdb->insert( $calendar_table, $insert_data );
return $insert;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |