PluginProbe
Nested Pages / 3.0.8
Nested Pages v3.0.8
3.3.1 3.2.15 3.2.14 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 All 106 releases
wp-nested-pages / app / Entities / Confirmation / TrashConfirmation.php
TrashConfirmation.php
39 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace NestedPages\Entities\Confirmation;
3
4 /**
5 * Confirm page(s) moved to trash
6 */
7 class TrashConfirmation implements ConfirmationInterface
8 {
9 public function setMessage()
10 {
11 $out = '';
12
13 // Show number of Links (np-redirect) Deleted if applicable
14 if ( isset($_GET['link_ids']) ) :
15 $links_trashed = ( explode(',', $_GET['link_ids']) );
16 $number_trashed = count($links_trashed);
17 $out .= ( $number_trashed > 1 )
18 ? ' ' . $number_trashed . ' ' . __('Links Removed.', 'wp-nested-pages') . ' '
19 : ' ' . $number_trashed . ' ' . __('Link Removed.', 'wp-nested-pages') . ' ';
20 endif;
21
22 // Post(s) Moved to Trash
23 if ( isset($_GET['ids']) ) :
24 $trashed = ( explode(',', $_GET['ids']) );
25 $post_type = get_post_type($trashed[0]);
26 $post_type_object = get_post_type_object($post_type);
27 $out .= ( count($trashed) > 1 )
28 ? count($trashed) . ' ' . esc_html($post_type_object->labels->name) . ' ' . __('moved to the Trash.', 'wp-nested-pages')
29 : '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('moved to the Trash.', 'wp-nested-pages');
30 // Undo Link
31 if ( current_user_can('delete_pages') ) {
32 $ids = preg_replace( '/[^0-9,]/', '', $_GET['ids'] );
33 $out .= ' <a href="' . wp_nonce_url( admin_url( 'edit.php?&post_type=' . esc_attr($post_type) . '&amp;doaction=undo'. '&amp;action=untrash&amp;ids=' . esc_attr($ids) ), 'bulk-posts') . '">' . __( 'Undo' ) . "</a>";
34 }
35 endif;
36
37 return $out;
38 }
39 }