Save metabox with multiple checkbox array
Try the following code. add_action( ‘add_meta_boxes’, function() { add_meta_box( ‘custom-metabox’, ‘Select values’, ‘fill_metabox’, ‘post’, ‘normal’ ); }); function fill_metabox( $post ) { wp_nonce_field( basename(__FILE__), ‘mam_nonce’ ); // How to use ‘get_post_meta()’ for multiple checkboxes as array? $postmeta = maybe_unserialize( get_post_meta( $post->ID, ‘elements’, true ) ); // Our associative array here. id = value $elements = … Read more