Title: Checkbox default get and fallback
Last modified: February 5, 2018

---

# Checkbox default get and fallback

 *  [puggan](https://wordpress.org/support/users/puggan/)
 * (@puggan)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checkbox-default-get-and-fallback/)
 * I have a radio button:
    `[radio subject use_label_element default:get default:
   3 "Support" "Retur / Reklamation" "Kontakt"]`
 * if there is a get parameter it should use it, and if not it should use nr 3,
   
   that works fine until this part of the code is executed:
 *     ```
       if ( $matches = $tag->get_first_match_option( '/^default:([0-9_]+)$/' ) ) {
       	$defaults = array_merge( $defaults, explode( '_', $matches[1] ) );
       }
       ```
   
 * That code overides the get-value, and merge in number 3 as well, so both are 
   marked as checked in the html, and the browser only shoing the last one, nr 3,
   as selected.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [puggan](https://wordpress.org/support/users/puggan/)
 * (@puggan)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checkbox-default-get-and-fallback/#post-9938726)
 * As a workaround, I implemented:
 *     ```
       if(!$multiple) {
       	$defaults = array_slice($defaults, 0, 1);
       }
       ```
   
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [8 years ago](https://wordpress.org/support/topic/checkbox-default-get-and-fallback/#post-10457401)
 * Thanks for reporting. This issue will be fixed in the next release of the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Checkbox default get and fallback’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/checkbox-default-get-and-fallback/#post-10457401)
 * Status: not resolved