using checked function to verify value against an array
OK Try the below $current = get_user_meta($user_id, ‘continent’, $true); $categories = get_categories( $args ); foreach ( $categories as $category ){ ?> <label><input type=”checkbox” id=”type-<?php echo $category->name; ?>” value=”<?php echo $category->name; ?>” class=”shopping” name=”top_level[]” <?php checked($category->name, $current); ?>><?php echo $category->name; ?> </label> <?php } If $current = get_user_meta($user_id, ‘continent’, $true); value is an array then try … Read more