}
}
+ public function get_permalink_path() {
+ $permalink = '/' . $this->slug;
+ if ($this->is_page == false) {
+ $permalink = '/' . date('Y', $this->date) . '/' . date('m', $this->date) . '/' . $this->slug;
+ }
+ return $permalink;
+ }
+
public function get_metadata() {
$data = [];
post_data,
post_data_version)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
- cx_db_exec($sql, $site_id, $creation_time, $update_time, $slug, $date, $page, $draft, $nav_index, $title, $data, 1);
+ $id = cx_db_exec($sql, $site_id, $creation_time, $update_time, $slug, $date, $page, $draft, $nav_index, $title, $data, 1);
+ return $id;
}
function cx_posts_update_post($post_id, $title, $slug, $date, $page, $draft, $nav_index, $data) {