PluginProbe
Assistant – Every Day Productivity Apps / 0.3.1
Assistant – Every Day Productivity Apps v0.3.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / Hooks / Actions / OnBeforeDeletePost.php

OnBeforeDeletePost.php in Assistant – Every Day Productivity Apps 0.3.1, at backend/src/Hooks/Actions/OnBeforeDeletePost.php

27 lines 522 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FL\Assistant\Hooks\Actions;
4
5 use FL\Assistant\Data\Repository\NotationsRepository;
6
7 /**
8 * Class OnBeforeDeletePost
9 * @package FL\Assistant\Hooks\Actions
10 */
11 class OnBeforeDeletePost {
12
13 protected $notations;
14
15 public function __construct( NotationsRepository $notations ) {
16 $this->notations = $notations;
17 }
18
19 public function __invoke( $post_id ) {
20 $results = $this->notations->get_notations( 'post', $post_id );
21
22 foreach ( $results as $notation ) {
23 wp_delete_post( $notation['id'] );
24 }
25 }
26 }
27