insert( [ 'action' => $action, 'object' => 'attachment', 'object_id' => $attachment_id, 'object_name' => esc_html( get_the_title( $attachment->ID ) ), ] ); } /** * When an attachment is deleted. * * @param integer $attachment_id * @return void */ public function deleteAttachment( $attachment_id ) { $this->_addLogAttachment( 'deleted', $attachment_id ); } /** * When an attachment is modified. * * @param integer $attachment_id * @return void */ public function editAttachment( $attachment_id ) { $this->_addLogAttachment( 'updated', $attachment_id ); } /** * When an attachment is added. * * @param integer $attachment_id * @return void */ public function addAttachment( $attachment_id ) { $this->_addLogAttachment( 'added', $attachment_id ); } }