PluginProbe ʕ •ᴥ•ʔ
Yoast Duplicate Post / 0.3
Yoast Duplicate Post v0.3
trunk 0.3 0.4 0.5 0.6 0.6.1 1.0 1.1 1.1.1 1.1.2 2.0 2.0.1 2.0.2 2.1 2.1.1 2.2 2.3 2.4 2.4.1 2.5 2.6 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 4.0 4.0.1 4.0.2 4.1 4.1.1 4.1.2 4.2 4.3 4.4 4.5 4.6
duplicate-post / save_as_new_post.php
duplicate-post Last commit date
duplicate-post.php 18 years ago gpl-3.0.txt 18 years ago make_duplicate_post.php 18 years ago readme.txt 18 years ago save_as_new_page.php 18 years ago save_as_new_post.php 18 years ago todo.txt 18 years ago
save_as_new_post.php
28 lines
1 <?php
2 if (!isset( $_GET['post'] ) && !isset( $_POST['post'] )) {
3 ?>
4 <div class="wrap">
5 <p><strong><?php _e('No post to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN) ?></strong></p>
6 </div>
7 <?php
8 } else {
9 // Get the original template
10 $id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
11 $post = duplicate_post_get_post($id);
12
13 // Copy the post and insert it as a template
14 if (isset($post) && $post!=null) {
15 $new_id = duplicate_post_create_duplicate_from_post($post);
16
17 // Show the post edit
18 echo '<meta content="0; URL=post.php?action=edit&post=' . $new_id . '" http-equiv="Refresh" />';
19 exit;
20 } else {
21 ?>
22 <div class="wrap">
23 <p><strong><?php _e('Post creation failed, could not find original post:', DUPLICATE_POST_I18N_DOMAIN) . ' ' . $id ?></strong></p>
24 </div>
25 <?php
26 }
27 }
28 ?>