I am creating my first ever plugin, its purpose is to show a notice when some conditions are met, I created the function in jQuery and initially I had to manually edit the file everytime I wanted to change the notice message, so I decided to create a settings page so that the user could edit the message from the front end.
Thanks to another member on stackxchange I was able to use wp localize to show the custom message saved in the wp options instead. however, I now find my self having to structure the message being shown such as;
Title
Message
Image
I don't want to create many options so I thought I could try and serialize the data but I dont know how to.
In the settings page I have a single textbox for the user to enter the message.
<textarea name="msg_data" id="msg_data" cols="40" rows="10" />
<?php echo get_option('notice_data'); ?>
</textarea>
Here is the localize
$custom_notice = get_option('notice_data', 'default_value');
wp_localize_script( 'lu_ban', 'custom_notice', $custom_notice);
My goal is to create three different inputs, one for title, one for body message and one for image path, can anyone help me out please.
THanks