PluginProbe
Post Duplicator / 2.26
Post Duplicator v2.26
3.0.16 trunk 1.1 2.0 2.2 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.3 2.30 2.31 2.32 2.33 2.34 2.35 2.36 2.37 2.38 All 52 releases
post-duplicator / includes / notices.php

notices.php in Post Duplicator 2.26, at includes/notices.php

30 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /* --------------------------------------------------------- */
4 /* !Create an admin notice that a post has been duplicated - 2.25 */
5 /* --------------------------------------------------------- */
6
7 function mtphr_post_duplicator_notice() {
8
9 $duplicated_id = isset( $_GET['post-duplicated'] ) ? intval( $_GET['post-duplicated'] ) : '';
10 if( $duplicated_id != '' ) {
11
12 $settings = get_mtphr_post_duplicator_settings();
13
14 // Get the post type object
15 $duplicated_post = get_post( $duplicated_id );
16 $post_type = get_post_type_object( $duplicated_post->post_type );
17
18 // Set the button label
19 $pt = $post_type->labels->singular_name;
20 $link = '<a href="'.get_edit_post_link( $duplicated_id ).'">'.esc_html__( 'here', 'post-duplicator' ).'</a>';
21 $label = sprintf( __( 'Successfully Duplicated! You can edit your new %1$s %2$s.', 'post-duplicator' ), $pt, $link );
22
23 ?>
24 <div class="updated">
25 <p><?php echo wp_kses_post( $label ); ?></p>
26 </div>
27 <?php
28 }
29 }
30 add_action('admin_notices', 'mtphr_post_duplicator_notice');