PHP array checkbox and radio default value
Posted
by
Arg Geo
on Stack Overflow
See other posts from Stack Overflow
or by Arg Geo
Published on 2012-06-09T22:30:38Z
Indexed on
2012/06/09
22:40 UTC
Read the original article
Hit count: 219
I have the code below in my wordpress options page. I can't define the default values for checkbox and radio.
array(
"name" => "Post Thumbnails",
"desc" => "Choose if you want to display <strong>post thumbnails</strong> or not.",
"id" => $shortname."_post_thumbs",
"type" => "checkbox",
"std" => "checked"
),
array(
"name" => "Example",
"desc" => " The Descriptions",
"id" => $shortname."_case_thumb",
"type" => "radio",
"options" => array("nothumb" => " Display nothing", "defthumb" => " Display thumbnail"),
"std" => "nothumb"
),
For the checkbox tried also "std" => "true"
and "std" => " "
... but didn't work. Thanks!
© Stack Overflow or respective owner