NavMenuActions.php
11 years ago
NavMenuRemoveItem.php
11 years ago
NavMenuRepository.php
11 years ago
NavMenuSync.php
11 years ago
NavMenuSyncInterface.php
11 years ago
NavMenuSyncListing.php
11 years ago
NavMenuSyncMenu.php
11 years ago
NavMenuTrashActions.php
11 years ago
NavMenuRemoveItem.php
28 lines
| 1 | <?php namespace NestedPages\Entities\NavMenu; |
| 2 | |
| 3 | /** |
| 4 | * Service Class for removing a single menu item |
| 5 | */ |
| 6 | class NavMenuRemoveItem { |
| 7 | |
| 8 | /** |
| 9 | * Item ID to Remove |
| 10 | * @var int - ID of nav menu item |
| 11 | */ |
| 12 | private $item_id; |
| 13 | |
| 14 | public function __construct($item_id) |
| 15 | { |
| 16 | $this->item_id = $item_id; |
| 17 | $this->removeItem(); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Delete the Item |
| 22 | */ |
| 23 | private function removeItem() |
| 24 | { |
| 25 | wp_delete_post($this->item_id, true); |
| 26 | } |
| 27 | |
| 28 | } |