Is there a way in Umbraco 17 to stop Unpublish an Item if it linked to another page

There are actually 2 appSettings for just this :

"Umbraco": {
  "CMS": {
    "Content": {
      "DisableDeleteWhenReferenced": false,
      "DisableUnpublishWhenReferenced": false      
    }
  }
}