01 - Preheat oven to 350°F. Line a 12-cup muffin tin with cupcake liners.
02 - Whisk together flour, baking powder, and salt in a bowl.
03 - In a separate large bowl, cream butter and sugar until light and fluffy. Add eggs one at a time, beating well after each, then mix in vanilla.
04 - Add flour mixture in three additions, alternating with milk, beginning and ending with flour. Mix until just combined.
05 - Divide batter evenly among cupcake liners. Bake 18–20 minutes, or until a toothpick inserted in the center comes out clean. Let cool in the pan for 5 minutes, then transfer to a wire rack to cool completely.
06 - Heat milk in a saucepan over medium heat until just simmering.
07 - Whisk egg yolks, sugar, cornstarch, and salt until pale and smooth.
08 - Gradually whisk hot milk into yolk mixture. Pour mixture back into saucepan and cook over medium heat, whisking constantly, until thick and bubbling, about 2–3 minutes. Remove from heat; stir in vanilla and butter until smooth. Transfer to a bowl, press plastic wrap directly onto surface, and chill until cold.
09 - Heat cream in a small saucepan until just simmering. Pour over chocolate in a heatproof bowl. Let sit 2 minutes, then stir until smooth. Allow to cool until slightly thickened but still pourable.
10 - Using a small knife or cupcake corer, cut a small hole in the center of each cupcake about 1 inch deep. Fill each with chilled pastry cream, about 1–2 teaspoons per cupcake. Replace the cut-out piece of cake on top.
11 - Spoon or dip the tops of the cupcakes in chocolate ganache. Let set before serving.