How to save custom form data in wp_options table
I have some data that I want stored in the wp_option table.
I know the code is not right but I want to store data in this way:
global $wpdb;
if (isset($_POST['add_estimated_satisfaction'])) {
// run validation if you're not doing it in js
$option_name = $confused_about_treatment_editor;
$option_name = $estimated_price_editor;
$option_name = $satisfaction_guarantee_editor;
$option_value = isset($_POST['confused_about_treatment']) ? $_POST['confused_about_treatment'] : '';
$option_value = isset($_POST['estimated_price']) ? $_POST['estimated_price'] : '';
$option_value = isset($_POST['satisfaction_guarantee']) ? $_POST['satisfaction_guarantee'] : '';
$status = $wpdb-insert('www_options', array(
'option_name' = $option_name,
'option_value' = $option_value,
));
if ($status == false) {
echo $msg_fail;
} else {
echo $msg_success_save;
};
go_back();
}
?
form method=POST
table width=95%
tr
td width=10%Confused about our treatment/td
td width=90%
?php
$confused_about_treatment_content = '';
$confused_about_treatment_editor = confused_about_treatment;
$confused_about_treatment_settings = array(
'textarea_name' = $confused_about_treatment_editor,
'textarea_rows' = 15,
'media_buttons' = false,
'teeny' = false,
'tinymce' = true,
'quicktags' = false,
);
?
textarea style=display:none name=?php $confused_about_treatment_editor ? id=?php $confused_about_treatment_editor ? rows=10 cols=100?php echo $confused_about_treatment_content ?/textarea
?php wp_editor($confused_about_treatment_content, $confused_about_treatment_editor,
$confused_about_treatment_settings); ?
/td
/tr
tr
td width=10%Tooltip Estimated Price/td
td width=90%
?php
$estimated_price_content = '';
$estimated_price_editor = estimated_price;
$estimated_price_settings = array(
'textarea_name' = $estimated_price_editor,
'textarea_rows' = 5,
'media_buttons' = false,
'teeny' = false,
'tinymce' = false,
'quicktags' = false,
);
?
textarea style=display:none name=?php $estimated_price_editor ? id=?php $estimated_price_editor ? rows=10 cols=100?php echo $estimated_price_content ?/textarea
?php wp_editor($estimated_price_content, $estimated_price_editor, $estimated_price_settings); ?
/td
/tr
tr
td width=10%Tooltip Satisfaction Guarantee/td
td width=90%
?php
$satisfaction_guarantee_content = '';
$satisfaction_guarantee_editor = satisfaction_guarantee;
$satisfaction_guarantee_settings = array(
'textarea_name' = $satisfaction_guarantee_editor,
'textarea_rows' = 5,
'media_buttons' = false,
'teeny' = false,
'tinymce' = false,
'quicktags' = false,
);
?
textarea style=display:none name=?php $satisfaction_guarantee_editor ? id=?php $satisfaction_guarantee_editor ? rows=10 cols=100?php echo $satisfaction_guarantee_content ?/textarea
?php wp_editor($satisfaction_guarantee_content, $satisfaction_guarantee_editor,
$satisfaction_guarantee_settings); ?
/td
/tr
tr
tdnbsp;/td
tdinput type=submit name=add_estimated_satisfaction value=Submit//td
/tr
/table
/form
Topic plugin-options Wordpress
Category Web