Preheat the oven to 375°F (190°C). Line a 12-cup muffin tin with paper liners or lightly grease it.
In a large bowl, whisk together the flour, sugar, baking powder, baking soda, cinnamon, and salt.
In a separate bowl, whisk the eggs, vegetable oil, milk, and vanilla extract until combined.
Add the wet ingredients to the dry ingredients and stir just until no dry flour remains. Do not overmix.
Fold in the diced apples and walnuts, if using.
Divide the batter evenly among the muffin cups, filling each about 3/4 full.
Bake for 18 to 22 minutes, or until a toothpick inserted into the center comes out clean.
Let the muffins cool in the pan for 5 minutes, then transfer to a wire rack to cool completely.