Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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!

share|improve this question
add only checked at "std" => "checked" – B4NZ41 Jun 9 '12 at 22:43
tried but didn't work.... – Arg Geo Jun 9 '12 at 22:44
2  
Can you tell us the context you are using this in? Like in a particular Wordpress Theme? or using a particular framework? – Chacha102 Jun 10 '12 at 0:41
Chacha102 I am using this in wordpress options page. – Arg Geo Jun 10 '12 at 19:35
Can't you just use checked => "checked" as in html? – RTB Jun 20 '12 at 13:52
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.