Italian (Italy)
Knowledge Base  >  Vik Appointments  >  Hook  >  Media  >  After Delete

apply_filters( 'vikappointments_after_delete_media', bool $status, string $id, string $path, JModel $model )

Fires after deleting a media file.


Description

Trigger hook to allow the plugins to make something after deleting one or more media files. Unlike the before_delete hook, this one fires once for each deleted media file.


Parameters

$status

(bool)  True on success, false otherwise.

$id

(string)  The name of the deleted media file. Occasionally, this argument may contain the full path.

$path

(string)  An optional path from which the file has been deleted. If not specified, the default media folder was used.

$model

(JModel)  The model instance that handles the deleting process.


Example

/**
 * Trigger event to allow the plugins to make something after
 * deleting a media file.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  mixed    $id      The file identifier.
 * @param  mixed    $path    An optional path from which the file should has been deleted.
 * @param  JModel   $model   The model instance.
 */
add_filter('vikappointments_after_delete_media', function($status, $id, $path, $model)
{
    /**
     * @todo do something after deleting the media file
     */

    return $status;
}, 10, 4);

Changelog

Version Description
1.2 Introduced.
Ultimo aggiornamento: 2021-10-08
Utile?
Potrebbe interessarti: