[wp-hackers] Saving Radio Options in Plugin Menu
BenderisGreat
greglancaster71 at gmail.com
Sat Nov 23 11:07:01 UTC 2013
Here is the code, when I select an option, nothing saved. var_dump on
$buttonStyle gives me a boolean false. Feel like I am missing something
here. How exactly should the input be saved? Do I need to validate or
sanitize the input of a radio button? Seems that I wouldnt need to since
its not really user input.
public function ams_choose_comment_buttons_setting() //checkbox input
{
$buttonStyle = get_option('ams_choose_comment_buttons');
var_dump($buttonStyle);
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="voteThumbs">voteThumbs', 'ams_choose_comment_buttons', checked(
'voteThumbs' == $buttonStyle ));
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="voteTextLinks">voteTextLinks', 'ams_choose_comment_buttons', checked(
'voteTextLinks' == $buttonStyle ));
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="voteThumbCount">voteThumbCount', 'ams_choose_comment_buttons',
checked( "voteThumbCount" == $buttonStyle ));
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="voteChevrons">voteChevrons', 'ams_choose_comment_buttons', checked(
"voteChevrons" == $buttonStyle ));
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="votePlusMinus">votePlusMinus', 'ams_choose_comment_buttons', checked(
"votePlusMinus" == $buttonStyle ));
printf(
'<input id="%s" type="radio" name="ams_options[%s]"
value="voteLikeDislike">voteLikeDislike', 'ams_choose_comment_buttons',
checked( "voteLikeDislike" == $buttonStyle ));
}
--
View this message in context: http://wordpress-hackers.1065353.n5.nabble.com/Saving-Radio-Options-in-Plugin-Menu-tp42904.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.
More information about the wp-hackers
mailing list