WordPress.org

Support

Support » Themes and Templates » [Resolved] Add checkbox to save page

[Resolved] Add checkbox to save page

  • Hey guys,

    I’m building my own WordPress theme and have a question.
    I want to save the value of a checkbox. Currently I have only text boxes.

    function manager_admin_menu() {

    if(isset($_GET[‘page’]) && $_GET[‘page’] == ‘test’) {

    if(isset($_POST[‘action’]) && $_POST[‘action’] == ‘save’) {

    $pics= array();

    foreach($_POST[‘src’] as $k => $v) {
    $pics[] = array(
    ‘src’ => $v,
    ‘link’ => $_POST[‘link’][$k],
    ‘caption’ => $_POST[‘caption’][$k]
    );
    }

    update_option(‘pics’, $pics);

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Add checkbox to save page’ is closed to new replies.