Yes, apple cores may attract wasps when buried in the compost pile. It will be especially when the compost pile is loaded with a lot of apples. It may be avoided by burying the apple cores deep in the compost pile.