public function onAfterUnpublish()
    {
        foreach ($this->owner->Fields() as $field) {
            $field->deleteFromStage(Versioned::LIVE);
        }
    }
public function onAfterUnpublish()
    {
        foreach ($this->owner->Fields() as $field) {
            $field->deleteFromStage(Versioned::LIVE);
        }
    }
public function onAfterUnpublish ( ) { foreach ( $ this -> owner -> Fields ( ) as $ field ) { $ field -> deleteFromStage ( Versioned :: LIVE ) ; } }
Remove all fields from the live stage when unpublishing the page
Remove all fields from the live stage when unpublishing the page