ConfirmationFactory.php
11 years ago
ConfirmationInterface.php
11 years ago
LinkDeletedConfirmation.php
11 years ago
TrashConfirmation.php
11 years ago
TrashRestoredConfirmation.php
11 years ago
TrashConfirmation.php
25 lines
| 1 | <?php namespace NestedPages\Entities\Confirmation; |
| 2 | /** |
| 3 | * Confirm page(s) moved to trash |
| 4 | */ |
| 5 | class TrashConfirmation implements ConfirmationInterface { |
| 6 | |
| 7 | public function setMessage() |
| 8 | { |
| 9 | $out = ''; |
| 10 | $trashed = ( explode(',', $_GET['ids']) ); |
| 11 | if ( count($trashed) > 1 ){ |
| 12 | $out .= count($trashed) . ' ' . __('pages moved to the Trash', 'nestedpages'); |
| 13 | } else { |
| 14 | $out .= '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('moved to the Trash', 'nestedpages'); |
| 15 | |
| 16 | // Undo Link |
| 17 | if ( current_user_can('delete_pages') ) { |
| 18 | $page_obj = get_post_type_object('page'); |
| 19 | $out .= ' <a href="' . wp_nonce_url( admin_url( sprintf( $page_obj->_edit_link . '&action=untrash', $trashed[0] ) ), 'untrash-post_' . $trashed[0] ) . '">' . __( 'Undo' ) . "</a>"; |
| 20 | } |
| 21 | } |
| 22 | return $out; |
| 23 | } |
| 24 | |
| 25 | } |