I am writing a plugin for category discounts. In Plugin Setting page, I have a Category and Discount_percentage fields. I am rending these as followings
function cat_slug_render( ) {
$options = get_option( 'slug-configuration' );
?>
<input type='text' size="50" name='slug-configuration[cat_slug]' value='<?php echo $options['cat_slug']; ?>'>
<?php
}
and defining the option as
add_settings_field(
'cat_slug', //id
'category Slug', //title
'cat_slug_render', // callable
'slug-configuration', // page
'configuration' // section
);
everything else is fine. I can save the settings, can retrieve it, can update it and all.
However, I can save just ONE value. My aim is to save multiple values using the same fields.
But I am confused here how can I do it. My ultimate goal is as follows
input cat slug
Input discount
Press save
this will insert a New record each time this process is done
any guidance or help is highly appreciated!