In a medium bowl, sift together flour, cocoa powder, baking powder and salt.
Melt the coconut oil in a small saucepan over very low heat. Once melted, turn off the heat, but leave oil in the pan on the stove, so that it stays warm but does not solidify.
In a separate medium bowl, mix together coconut milk, sugar, vanilla and coconut extract. Stir in the melted coconut oil.
Add the flour mixture in batches, beating well after each addition. Mix until smooth, then fold in the shredded coconut.
Fill cupcake liners two-thirds full. Bake for 24 to 26 minutes.