true], 'objects'); foreach ($all_post_types as $post_type) { if ($post_type->name === 'attachment') { continue; } echo ''; echo 'name, $post_types_array) ? ' checked="checked"' : '') . '>'; echo esc_html($post_type->label); echo ''; // Add a line break for better spacing }