set featured_id to 0 if the featured image is deleted
This commit is contained in:
parent
5ef6268e54
commit
06cba13b8c
1 changed files with 9 additions and 0 deletions
|
@ -71,6 +71,15 @@ class Featured extends Extension
|
|||
}
|
||||
}
|
||||
|
||||
public function onImageDeletion(ImageDeletionEvent $event)
|
||||
{
|
||||
global $config;
|
||||
if($event->image->id == $config->get_int("featured_id")) {
|
||||
$config->set_int("featured_id", 0);
|
||||
$config->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
|
||||
{
|
||||
global $user;
|
||||
|
|
Reference in a new issue