May I delete a page programmatically if it has subpages?

:+1:

Issue describe there:

@gillesvauvarin Instead of deleting everything in a duplicate:after hook, may I suggest you use a duplicate:before hook instead to tell users to uncheck the β€œCopy pages” option:

 'page.duplicate:before' => function ($duplicatePage, $input, $options) {
    if(empty($options['children']) === false) {
        throw new Exception('Please uncheck the "Copy pages" option');
    }
},

(You might want to add another if statement to limit this to campaign templates only)

Makes more sense to me than letting Kirby copy all the stuff only to remove it again afterwards.

This should be fixed in 3.3.0.