{"issue":{"title":"Multicheck stores a new value on every save","user":{"login":"billerickson","id":685131,"url":"https://api.github.com/users/billerickson","avatar_url":"https://secure.gravatar.com/avatar/ae510affa31e5b946623bda4ff969b67?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ae510affa31e5b946623bda4ff969b67"},"created_at":"2011-12-05T01:37:49Z","milestone":null,"labels":[{"name":"bug","url":"https://api.github.com/repos/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/labels/bug","color":"e10c02"}],"state":"closed","updated_at":"2011-12-29T19:10:19Z","id":2444918,"closed_at":"2011-12-29T17:44:08Z","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/issues/48","body":"Using the code from example-functions.php:\r\n\r\n```\r\n\r\narray(\r\n\t'name' => 'Test Multi Checkbox',\r\n\t'desc' => 'field description (optional)',\r\n\t'id' => 'test_multicheckbox',\r\n\t'type' => 'multicheck',\r\n\t'options' => array(\r\n\t\t'check1' => 'Check One',\r\n\t\t'check2' => 'Check Two',\r\n\t\t'check3' => 'Check Three',\r\n\t)\r\n),\r\n```\r\n\r\nThen add this to page.php (or single.php if your metabox is on posts):\r\n\r\n```\r\n\r\n\tglobal $post;\r\n\t$multicheck = get_post_meta( $post->ID, 'test_multicheckbox' );\r\n\techo '<pre>';\r\n\tprint_r( $multicheck );\r\n\techo '</pre>';\r\n```\r\n\r\nEvery time you save, it adds the value again to the array. Here's what it looks like after I save it 4 times:\r\n\r\n```\r\nArray\r\n(\r\n    [0] => check1\r\n    [1] => check2\r\n    [2] => check1\r\n    [3] => check2\r\n    [4] => check1\r\n    [5] => check2\r\n    [6] => check1\r\n    [7] => check2\r\n    [8] => check1\r\n    [9] => check2\r\n)\r\n```\r\n\r\nWhen the value is saved, it should do something like $meta = array_unique( $meta ); to remove duplicates. \r\n\r\nThis should be considered in @randyhoyt 's improvements to multi-value fields in #44","number":48,"url":"https://api.github.com/repos/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/issues/48","comments":5,"assignee":null},"comment":{"user":{"login":"jbreitenbucher","id":593356,"url":"https://api.github.com/users/jbreitenbucher","avatar_url":"https://secure.gravatar.com/avatar/66ba33bbc8362c179cc75b240022bd0b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"66ba33bbc8362c179cc75b240022bd0b"},"created_at":"2011-12-29T19:10:19Z","updated_at":"2011-12-29T19:10:19Z","id":3303993,"body":"I just downloaded trunk and still get the same behavior. I check values for the multicheck and nothing is stored.","url":"https://api.github.com/repos/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/issues/comments/3303993"},"action":"created"}