14.2 Dữ liệu sử dụng ở save_themplate (ok)
Từ bước chuẩn bị tìm hiểu ở 14.1 giờ ta lấy dữ liệu sang class-wpf-form_ct.php

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-form_ct.php
public function save_themplate(array $post) {
$result = false;
if (!empty($post['layout'])) {
$option = WPF_Options_CT::get_option($this->plugin_name, $this->version);
if (empty($post['name'])) {
$post['name'] = uniqid($this->plugin_name . '_');
}
$themplate_id = !empty($post['themplate_id']) ? $post['themplate_id'] : $option->unique_name($post['name']);
$data = $option->get();
$layout = stripslashes_deep($post['layout']);
}
return $result;
}
Last updated
Was this helpful?