How to save the values of checkbox to the register setting of wordpress? (1 post)

  1. vicky081
    Posted 3 years ago #

    function default_menu() {
    <form action="options.php" method="post">
     <?php settings_fields( 'sample_check' );?>
    <input type="checkbox" name="sample" value="nofollow"/>
    function reg_setting() {

    Hi all, I struggle for the day to store the check box values to the register setting . For the text box i used directly like

    <input type="text" name="sam" value="<?php get_option('samip');?>" />

    Also I register the values to the register setting like


    But i don't know how to do this for checkbox anyone give me a suggestion to do this is great.

    Thanks, vicky

Topic Closed

This topic has been closed to new replies.

About this Topic