Duplicate Post - Version 2.0

Version Description

Several improvements and new features, see changelog. Requires WP 3.0+.

Download this release

Release Info

Developer lopo
Plugin Icon 128x128 Duplicate Post
Version 2.0
Comparing to
See all releases

Code changes from version 1.1.2 to 2.0

duplicate-post-admin.php CHANGED
@@ -3,75 +3,24 @@
3
  if(!is_admin())
4
  return;
5
 
6
- /*
7
- * This function calls the creation of a new copy of the selected post (as a draft)
8
- * then redirects to the edit post screen
9
- */
10
- function duplicate_post_save_as_new_post(){
11
- if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
12
- wp_die(__('No post to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN));
13
- }
14
-
15
- // Get the original post
16
- $id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
17
- $post = duplicate_post_get_post($id);
18
 
19
- // Copy the post and insert it
20
- if (isset($post) && $post!=null) {
21
- $new_id = duplicate_post_create_duplicate_from_post($post);
22
-
23
- // If you have written a plugin which uses non-WP database tables to save
24
- // information about a post you can hook this action to dupe that data.
25
- do_action( 'dp_duplicate_post', $new_id, $post );
26
-
27
- // Redirect to the edit screen for the new draft post
28
- wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_id ) );
29
- exit;
30
- } else {
31
- wp_die(__('Post creation failed, could not find original post:', DUPLICATE_POST_I18N_DOMAIN) . ' ' . $id);
32
- }
33
- }
34
 
35
- /*
36
- * Same as above, for pages
37
  */
38
- function duplicate_post_save_as_new_page(){
39
- if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_page' == $_REQUEST['action'] ) ) ) {
40
- wp_die(__('No page to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN));
41
- }
42
-
43
- // Get the original page
44
- $id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
45
- $post = duplicate_post_get_page($id);
46
-
47
- // Copy the page and insert it
48
- if (isset($post) && $post!=null) {
49
- $new_id = duplicate_post_create_duplicate_from_page($post);
50
-
51
- // If you have written a plugin which uses non-WP database tables to save
52
- // information about a page you can hook this action to dupe that data.
53
- do_action( 'dp_duplicate_page', $new_id, $post );
54
-
55
- // Redirect to the edit screen for the new draft page
56
- wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_id ) );
57
- exit;
58
- } else {
59
- wp_die(__('Post creation failed, could not find original post:', DUPLICATE_POST_I18N_DOMAIN) . ' ' . $id);
60
- }
61
  }
62
 
63
- // Version of the plugin
64
- define('DUPLICATE_POST_CURRENT_VERSION', '1.1' );
65
- define('DUPLICATE_POST_COLUMN', 'control_duplicate_post');
66
-
67
- // i18n plugin domain
68
- define('DUPLICATE_POST_I18N_DOMAIN', 'duplicate-post');
69
-
70
  /**
71
- * Initialise the internationalisation domain
72
  */
73
- load_plugin_textdomain(DUPLICATE_POST_I18N_DOMAIN,
74
- 'wp-content/plugins/duplicate-post/languages','duplicate-post/languages');
 
75
 
76
  /**
77
  * Plugin activation
@@ -93,90 +42,31 @@ function duplicate_post_plugin_activation() {
93
  'duplicate_post_copy_user_level',
94
  '5',
95
  'Default user level to copy posts' );
 
 
 
 
 
 
 
 
96
  }
97
  // Update version number
98
  update_option( 'duplicate_post_version', duplicate_post_get_current_version() );
99
  }
100
 
101
- /**
102
- * Check if WP version < 2.8: if so, post_row_actions does not exist, so we must add a custom column (the old way)
103
- */
104
- global $wp_version;
105
- if (strncmp($wp_version, "2.7",3) == 0 ){
106
- add_filter('manage_posts_columns', 'duplicate_post_add_duplicate_post_column');
107
- // Added by WarmStal
108
- add_filter('manage_pages_columns', 'duplicate_post_add_duplicate_post_column');
109
- add_action('manage_posts_custom_column', 'duplicate_post_make_duplicate_link', 10, 2);
110
- // Added by WarmStal
111
- add_action('manage_pages_custom_column', 'duplicate_page_make_duplicate_link', 10, 2);
112
- } else {
113
- /**
114
- * Add to the links shown when the mouse gets over a post title in 'Edit Posts' or 'Edit Pages' screen
115
- */
116
- add_filter('post_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
117
- add_filter('page_row_actions', 'duplicate_page_make_duplicate_link_row',10,2);
118
- }
119
-
120
- /**
121
- * WP version < 2.8: add a custom column
122
- */
123
- function duplicate_post_add_duplicate_post_column($columns) {
124
- if (duplicate_post_is_current_user_allowed_to_copy()) {
125
- $columns[DUPLICATE_POST_COLUMN] = '';
126
- }
127
- return $columns;
128
- }
129
-
130
- /**
131
- * WP version < 2.8: add link to custom column for posts
132
- */
133
- function duplicate_post_make_duplicate_link($column_name, $id) {
134
- if (duplicate_post_is_current_user_allowed_to_copy()) {
135
- if ($column_name == DUPLICATE_POST_COLUMN) {
136
- echo "<a href='admin.php?action=duplicate_post_save_as_new_post&amp;post=" . $id
137
- . "' title='" . __("Make a duplicate from this post", DUPLICATE_POST_I18N_DOMAIN)
138
- . "' class='edit'>" . __("Duplicate", DUPLICATE_POST_I18N_DOMAIN) . "</a>";
139
- }
140
- }
141
- }
142
-
143
- /**
144
- * WP version < 2.8: add link to custom column for pages
145
- */
146
- // Added by WarmStal
147
- function duplicate_page_make_duplicate_link($column_name, $id) {
148
- if (duplicate_post_is_current_user_allowed_to_copy()) {
149
- if ($column_name == DUPLICATE_POST_COLUMN) {
150
- echo "<a href='admin.php?action=duplicate_post_save_as_new_page&amp;post=" . $id
151
- . "' title='" . __("Make a duplicate from this page", DUPLICATE_POST_I18N_DOMAIN)
152
- . "' class='edit'>" . __("Duplicate", DUPLICATE_POST_I18N_DOMAIN) . "</a>";
153
- }
154
- }
155
- }
156
-
157
- /**
158
- * Connect actions to functions
159
- */
160
- add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
161
- add_action('admin_action_duplicate_post_save_as_new_page', 'duplicate_post_save_as_new_page');
162
 
163
  /**
164
  * Add the link to action list for post_row_actions
165
  */
166
  function duplicate_post_make_duplicate_link_row($actions, $post) {
167
  if (duplicate_post_is_current_user_allowed_to_copy()) {
168
- $actions['duplicate'] = '<a href="admin.php?action=duplicate_post_save_as_new_post&amp;post=' . $post->ID . '" title="' . __("Make a duplicate from this post", DUPLICATE_POST_I18N_DOMAIN)
169
- . '" rel="permalink">' . __("Duplicate", DUPLICATE_POST_I18N_DOMAIN) . '</a>';
170
- }
171
- return $actions;
172
- }
173
-
174
- /**
175
- * Add the link to action list for page_row_actions
176
- */
177
- function duplicate_page_make_duplicate_link_row($actions, $page) {
178
- if (duplicate_post_is_current_user_allowed_to_copy()) {
179
- $actions['duplicate'] = '<a href="admin.php?action=duplicate_post_save_as_new_page&amp;post=' . $page->ID . '" title="' . __("Make a duplicate from this page", DUPLICATE_POST_I18N_DOMAIN)
180
  . '" rel="permalink">' . __("Duplicate", DUPLICATE_POST_I18N_DOMAIN) . '</a>';
181
  }
182
  return $actions;
@@ -189,94 +79,63 @@ add_action( 'post_submitbox_start', 'duplicate_post_add_duplicate_post_button' )
189
 
190
  function duplicate_post_add_duplicate_post_button() {
191
  if ( isset( $_GET['post'] ) && duplicate_post_is_current_user_allowed_to_copy()) {
192
- $act = "admin.php?action=duplicate_post_save_as_new_post";
193
  global $post;
194
- if ($post->post_type == "page") $act = "admin.php?action=duplicate_post_save_as_new_page";
195
  $notifyUrl = $act."&post=" . $_GET['post'];
196
  ?>
197
- <div id="duplicate-action"><a class="submitduplicate duplication"
198
- href="<?php echo $notifyUrl; ?>"><?php _e('Copy to a new draft', DUPLICATE_POST_I18N_DOMAIN); ?></a>
 
 
199
  </div>
200
  <?php
201
  }
202
  }
203
 
204
  /**
205
- * Wrapper for the option 'duplicate_post_create_user_level'
206
- */
207
- function duplicate_post_get_copy_user_level() {
208
- return get_option( 'duplicate_post_copy_user_level' );
209
- }
210
-
211
- /**
212
- * Wrapper for the option 'duplicate_post_create_user_level'
213
  */
214
- function duplicate_post_set_copy_user_level($new_level) {
215
- return update_option( 'duplicate_post_copy_user_level', $new_level );
216
- }
217
 
218
- /**
219
- * Wrapper for the option 'duplicate_post_version'
 
220
  */
221
- function duplicate_post_get_installed_version() {
222
- return get_option( 'duplicate_post_version' );
223
  }
224
 
225
- /**
226
- * Wrapper for the defined constant DUPLICATE_POST_CURRENT_VERSION
 
227
  */
228
- function duplicate_post_get_current_version() {
229
- return DUPLICATE_POST_CURRENT_VERSION;
230
- }
 
231
 
232
- /**
233
- * Test if the user is allowed to create templates
234
- */
235
- function duplicate_post_is_current_user_allowed_to_copy() {
236
- return current_user_can("level_" . duplicate_post_get_copy_user_level());
237
- }
238
 
239
- /**
240
- * Get a level given a role
241
- */
242
- function duplicate_post_get_level_from_role($role) {
243
- switch ($role) {
244
- case 0: // subscribers 0
245
- return 0;
246
- case 1: // contributors 1
247
- return 1;
248
- case 2: // authors 2..4
249
- return 2;
250
- case 3: // editors 5..7
251
- return 5;
252
- case 4: // administrators 8..10
253
- return 8;
254
- default: // error
255
- return 0;
256
- }
257
- }
258
 
259
- /**
260
- * Get a role given a level
261
- */
262
- function duplicate_post_get_role_from_level($level) {
263
- if ($level<=0) {
264
- // subscribers 0
265
- return 0;
266
- } else if ($level==1) {
267
- // contributors 1
268
- return 1;
269
- } else if ($level>=2 && $level<=4) {
270
- // authors 2..4
271
- return 2;
272
- } else if ($level>=5 && $level<=7) {
273
- // editors 5..7
274
- return 3;
275
- } else if ($level>=8) {
276
- // admins 8..10
277
- return 4;
278
  }
279
- return 0;
280
  }
281
 
282
  /**
@@ -296,46 +155,14 @@ function duplicate_post_get_current_user() {
296
  }
297
  }
298
 
299
- /**
300
- * Escape single quotes, specialchar double quotes, and fix line endings.
301
- */
302
- function duplicate_post_js_escape($text) {
303
- if (function_exists('js_escape')) {
304
- return js_escape($text);
305
- } else {
306
- $safe_text = str_replace('&&', '&#038;&', $text);
307
- $safe_text = str_replace('&&', '&#038;&', $safe_text);
308
- $safe_text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&#038;$1', $safe_text);
309
- $safe_text = str_replace('<', '&lt;', $safe_text);
310
- $safe_text = str_replace('>', '&gt;', $safe_text);
311
- $safe_text = str_replace('"', '&quot;', $safe_text);
312
- $safe_text = str_replace('&#039;', "'", $safe_text);
313
- $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
314
- return safe_text;
315
- }
316
- }
317
-
318
- /**
319
- * Get a page from the database
320
- */
321
- function duplicate_post_get_page($id) {
322
- global $wpdb;
323
- $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
324
- if ($post->post_type == "revision"){
325
- $id = $post->post_parent;
326
- $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
327
- }
328
- return $post[0];
329
- }
330
-
331
  /**
332
  * Get a post from the database
333
  */
334
  function duplicate_post_get_post($id) {
335
  global $wpdb;
336
  $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
337
- if ($post->post_type == "revision"){
338
- $id = $post->post_parent;
339
  $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
340
  }
341
  return $post[0];
@@ -347,9 +174,11 @@ function duplicate_post_get_post($id) {
347
  function duplicate_post_copy_post_taxonomies($id, $new_id, $post_type) {
348
  global $wpdb;
349
  if (isset($wpdb->terms)) {
350
- // WordPress 2.3
351
  $taxonomies = get_object_taxonomies($post_type); //array("category", "post_tag");
 
 
352
  foreach ($taxonomies as $taxonomy) {
 
353
  $post_terms = wp_get_object_terms($id, $taxonomy);
354
  for ($i=0; $i<count($post_terms); $i++) {
355
  wp_set_object_terms($new_id, $post_terms[$i]->slug, $taxonomy, true);
@@ -383,179 +212,77 @@ function duplicate_post_copy_post_meta_info($id, $new_id) {
383
  /**
384
  * Create a duplicate from a post
385
  */
386
- function duplicate_post_create_duplicate_from_post($post) {
387
  global $wpdb;
388
  //$new_post_type = 'post';
389
  $new_post_author = duplicate_post_get_current_user();
390
  $new_post_date = (get_option('duplicate_post_copydate') == 1)? $post->post_date : current_time('mysql');
391
  $new_post_date_gmt = get_gmt_from_date($new_post_date);
392
  $prefix = get_option('duplicate_post_title_prefix');
 
393
  if (!empty($prefix)) $prefix.= " ";
 
394
 
395
  $new_post_type = $post->post_type;
396
  $post_content = str_replace("'", "''", $post->post_content);
397
  $post_content_filtered = str_replace("'", "''", $post->post_content_filtered);
398
- $post_excerpt = str_replace("'", "''", $post->post_excerpt);
399
- $post_title = $prefix.str_replace("'", "''", $post->post_title);
400
- $post_status = str_replace("'", "''", $post->post_status);
401
- $post_name = str_replace("'", "''", $post->post_name);
 
 
 
 
 
 
402
  $comment_status = str_replace("'", "''", $post->comment_status);
403
  $ping_status = str_replace("'", "''", $post->ping_status);
404
 
405
  // Insert the new template in the post table
406
  $wpdb->query(
407
  "INSERT INTO $wpdb->posts
408
- (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type)
409
  VALUES
410
- ('$new_post_author->ID', '$new_post_date', '$new_post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', 'draft', '$new_post_type', '$comment_status', '$ping_status', '$post->post_password', '$post->to_ping', '$post->pinged', '$new_post_date', '$new_post_date_gmt', '$post->post_parent', '$post->menu_order', '$post->post_mime_type')");
411
 
412
  $new_post_id = $wpdb->insert_id;
413
 
414
- // Copy the taxonomies
415
- duplicate_post_copy_post_taxonomies($post->ID, $new_post_id, $post->post_type);
416
-
417
- // Copy the meta information
418
- duplicate_post_copy_post_meta_info($post->ID, $new_post_id);
419
-
420
- return $new_post_id;
421
- }
422
-
423
- /**
424
- * Create a duplicate from a page
425
- */
426
- function duplicate_post_create_duplicate_from_page($post) {
427
- global $wpdb;
428
- //$new_post_type = 'page';
429
- $new_post_author = duplicate_post_get_current_user();
430
- $new_post_date = (get_option('duplicate_post_copydate') == 1)? $post->post_date : current_time('mysql');
431
- $new_post_date_gmt = get_gmt_from_date($new_post_date);
432
- $prefix = get_option('duplicate_post_title_prefix');
433
- if (!empty($prefix)) $prefix.= " ";
434
-
435
- $new_post_type = $post->post_type;
436
- $post_content = str_replace("'", "''", $post->post_content);
437
- $post_content_filtered = str_replace("'", "''", $post->post_content_filtered);
438
- $post_excerpt = str_replace("'", "''", $post->post_excerpt);
439
- $post_title = $prefix.str_replace("'", "''", $post->post_title);
440
- $post_status = str_replace("'", "''", $post->post_status);
441
- $post_name = str_replace("'", "''", $post->post_name);
442
- $comment_status = str_replace("'", "''", $post->comment_status);
443
- $ping_status = str_replace("'", "''", $post->ping_status);
444
 
445
- // Insert the new template in the post table
446
- $wpdb->query(
447
- "INSERT INTO $wpdb->posts
448
- (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type)
449
- VALUES
450
- ('$new_post_author->ID', '$new_post_date', '$new_post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', 'draft', '$new_post_type', '$comment_status', '$ping_status', '$post->post_password', '$post_name', '$post->to_ping', '$post->pinged', '$new_post_date', '$new_post_date_gmt', '$post->post_parent', '$post->menu_order', '$post->post_mime_type')");
451
 
452
- $new_page_id = $wpdb->insert_id;
453
 
454
  // Copy the taxonomies
455
- duplicate_post_copy_post_taxonomies($post->ID, $new_page_id, $post->post_type);
456
 
457
  // Copy the meta information
458
- duplicate_post_copy_post_meta_info($post->ID, $new_page_id);
459
-
460
- return $new_page_id;
461
- }
462
-
463
-
464
- /**
465
- * Add an option page where you can specify which meta fields you don't want to copy
466
- */
467
- if ( is_admin() ){ // admin actions
468
- add_action('admin_menu', 'duplicate_post_menu');
469
- add_action( 'admin_init', 'duplicate_post_register_settings');
470
- }
471
-
472
- function duplicate_post_register_settings() { // whitelist options
473
- register_setting( 'duplicate_post_group', 'duplicate_post_copydate');
474
- register_setting( 'duplicate_post_group', 'duplicate_post_blacklist');
475
- register_setting( 'duplicate_post_group', 'duplicate_post_title_prefix');
476
- register_setting( 'duplicate_post_group', 'duplicate_post_copy_user_level');
477
- }
478
 
 
479
 
480
- function duplicate_post_menu() {
481
- add_options_page(__("Duplicate Post Options", DUPLICATE_POST_I18N_DOMAIN), __("Duplicate Post", DUPLICATE_POST_I18N_DOMAIN), 'administrator', 'duplicatepost', 'duplicate_post_options');
482
- }
 
 
 
483
 
484
- function duplicate_post_options() {
485
- ?>
486
- <div class="wrap">
487
- <h2><?php _e("Duplicate Post", DUPLICATE_POST_I18N_DOMAIN); ?></h2>
488
-
489
- <form method="post" action="options.php"><?php settings_fields('duplicate_post_group'); ?>
490
-
491
- <table class="form-table">
492
-
493
- <tr valign="top">
494
- <th scope="row"><?php _e("Copy post/page date also", DUPLICATE_POST_I18N_DOMAIN); ?></th>
495
- <td><input type="checkbox" name="duplicate_post_copydate" value="1" <?php if(get_option('duplicate_post_copydate') == 1) echo 'checked="checked"'; ?>"/>
496
- <span class="description"><?php _e("Normally, the new draft has publication date set to current time: check the box to copy the original post/page date", DUPLICATE_POST_I18N_DOMAIN); ?></span>
497
- </td>
498
- </tr>
499
- <tr valign="top">
500
- <th scope="row"><?php _e("Do not copy these fields", DUPLICATE_POST_I18N_DOMAIN); ?></th>
501
- <td><input type="text" name="duplicate_post_blacklist"
502
- value="<?php echo get_option('duplicate_post_blacklist'); ?>" /> <span
503
- class="description"><?php _e("Comma-separated list of meta fields that must not be copied when cloning a post/page", DUPLICATE_POST_I18N_DOMAIN); ?></span>
504
- </td>
505
- </tr>
506
- <tr valign="top">
507
- <th scope="row"><?php _e("Title prefix", DUPLICATE_POST_I18N_DOMAIN); ?></th>
508
- <td><input type="text" name="duplicate_post_title_prefix"
509
- value="<?php echo get_option('duplicate_post_title_prefix'); ?>" /> <span
510
- class="description"><?php _e("Prefix to be added before the original title when cloning a post/page, e.g. \"Copy of\" (blank for no prefix)", DUPLICATE_POST_I18N_DOMAIN); ?></span>
511
- </td>
512
- </tr>
513
- <tr valign="top">
514
- <th scope="row"><?php _e("Minimum level to copy posts", DUPLICATE_POST_I18N_DOMAIN); ?></th>
515
- <td><select name="duplicate_post_copy_user_level">
516
- <?php global $wp_version;
517
- if (strncmp($wp_version, "2.7",3) == 0 ){ ?>
518
- <option value="1"
519
- <?php if(get_option('duplicate_post_copy_user_level') == 1) echo 'selected="selected"'?>><?php echo _c("Contributor|User role", "default")?></option>
520
- <option value="2"
521
- <?php if(get_option('duplicate_post_copy_user_level') == 2) echo 'selected="selected"'?>><?php echo _c("Author|User role", "default")?></option>
522
- <option value="5"
523
- <?php if(get_option('duplicate_post_copy_user_level') == 5) echo 'selected="selected"'?>><?php echo _c("Editor|User role", "default")?></option>
524
- <option value="8"
525
- <?php if(get_option('duplicate_post_copy_user_level') == 8) echo 'selected="selected"'?>><?php echo _c("Administrator|User role", "default")?></option>
526
-
527
- <?php } else { ?>
528
- <option value="1"
529
- <?php if(get_option('duplicate_post_copy_user_level') == 1) echo 'selected="selected"'?>><?php echo _x("Contributor", "User role", "default")?></option>
530
- <option value="2"
531
- <?php if(get_option('duplicate_post_copy_user_level') == 2) echo 'selected="selected"'?>><?php echo _x("Author", "User role", "default")?></option>
532
- <option value="5"
533
- <?php if(get_option('duplicate_post_copy_user_level') == 5) echo 'selected="selected"'?>><?php echo _x("Editor", "User role", "default")?></option>
534
- <option value="8"
535
- <?php if(get_option('duplicate_post_copy_user_level') == 8) echo 'selected="selected"'?>><?php echo _x("Administrator", "User role", "default")?></option>
536
-
537
- <?php };?>
538
- </select> <span class="description"><?php _e("Warning: users will be able to copy all posts, even those of higher level users", DUPLICATE_POST_I18N_DOMAIN); ?></span>
539
- </td>
540
- </tr>
541
-
542
- </table>
543
-
544
- <p class="submit"><input type="submit" class="button-primary"
545
- value="<?php _e('Save Changes', DUPLICATE_POST_I18N_DOMAIN) ?>" /></p>
546
-
547
- </form>
548
- </div>
549
- <?php
550
  }
551
 
552
  //Add some links on the plugin page
553
  add_filter('plugin_row_meta', 'duplicate_post_add_plugin_links', 10, 2);
554
 
555
  function duplicate_post_add_plugin_links($links, $file) {
556
- if ( $file == plugin_basename(__FILE__) ) {
557
- $links[] = '<a href="http://www.lopo.it/duplicate-post-plugin">' . __('Donate', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
558
- $links[] = '<a href="http://www.lopo.it/duplicate-post-plugin">' . __('Translate', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
559
  }
560
  return $links;
561
  }
3
  if(!is_admin())
4
  return;
5
 
6
+ require_once (dirname(__FILE__).'/duplicate-post-options.php');
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ // Version of the plugin
9
+ define('DUPLICATE_POST_CURRENT_VERSION', '2.0' );
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ /**
12
+ * Wrapper for the option 'duplicate_post_version'
13
  */
14
+ function duplicate_post_get_installed_version() {
15
+ return get_option( 'duplicate_post_version' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
 
 
 
 
 
 
 
18
  /**
19
+ * Wrapper for the defined constant DUPLICATE_POST_CURRENT_VERSION
20
  */
21
+ function duplicate_post_get_current_version() {
22
+ return DUPLICATE_POST_CURRENT_VERSION;
23
+ }
24
 
25
  /**
26
  * Plugin activation
42
  'duplicate_post_copy_user_level',
43
  '5',
44
  'Default user level to copy posts' );
45
+ add_option(
46
+ 'duplicate_post_copyexcerpt',
47
+ '1',
48
+ 'Copy the excerpt from the original post/page' );
49
+ add_option(
50
+ 'duplicate_post_taxonomies_blacklist',
51
+ array(),
52
+ 'List of the taxonomies that mustn\'t be copied' );
53
  }
54
  // Update version number
55
  update_option( 'duplicate_post_version', duplicate_post_get_current_version() );
56
  }
57
 
58
+ add_filter('post_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
59
+ add_filter('page_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  /**
62
  * Add the link to action list for post_row_actions
63
  */
64
  function duplicate_post_make_duplicate_link_row($actions, $post) {
65
  if (duplicate_post_is_current_user_allowed_to_copy()) {
66
+ $theUrl = admin_url('admin.php?action=duplicate_post_save_as_new_post&amp;post=' . $post->ID);
67
+ $post_type_obj = get_post_type_object( $post->post_type );
68
+ $actions['duplicate'] = '<a href="'.$theUrl.'" title="'
69
+ . esc_attr(__("Clone this item", DUPLICATE_POST_I18N_DOMAIN))
 
 
 
 
 
 
 
 
70
  . '" rel="permalink">' . __("Duplicate", DUPLICATE_POST_I18N_DOMAIN) . '</a>';
71
  }
72
  return $actions;
79
 
80
  function duplicate_post_add_duplicate_post_button() {
81
  if ( isset( $_GET['post'] ) && duplicate_post_is_current_user_allowed_to_copy()) {
82
+ $act = "admin.php?action=duplicate_post_save_as_new_post_draft";
83
  global $post;
 
84
  $notifyUrl = $act."&post=" . $_GET['post'];
85
  ?>
86
+ <div id="duplicate-action">
87
+ <a class="submitduplicate duplication"
88
+ href="<?php echo admin_url($notifyUrl); ?>"><?php _e('Copy to a new draft', DUPLICATE_POST_I18N_DOMAIN); ?>
89
+ </a>
90
  </div>
91
  <?php
92
  }
93
  }
94
 
95
  /**
96
+ * Connect actions to functions
 
 
 
 
 
 
 
97
  */
98
+ add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
99
+ add_action('admin_action_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
 
100
 
101
+ /*
102
+ * This function calls the creation of a new copy of the selected post (as a draft)
103
+ * then redirects to the edit post screen
104
  */
105
+ function duplicate_post_save_as_new_post_draft(){
106
+ duplicate_post_save_as_new_post('draft');
107
  }
108
 
109
+ /*
110
+ * This function calls the creation of a new copy of the selected post (preserving the original publish status)
111
+ * then redirects to the post list
112
  */
113
+ function duplicate_post_save_as_new_post($status = ''){
114
+ if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
115
+ wp_die(__('No post to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN));
116
+ }
117
 
118
+ // Get the original post
119
+ $id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
120
+ $post = duplicate_post_get_post($id);
 
 
 
121
 
122
+ // Copy the post and insert it
123
+ if (isset($post) && $post!=null) {
124
+ $new_id = duplicate_post_create_duplicate($post, $status);
125
+
126
+ if ($status == ''){
127
+ // Redirect to the post list screen
128
+ wp_redirect( admin_url( 'edit.php?post_type='.$post->post_type) );
129
+ } else {
130
+ // Redirect to the edit screen for the new draft post
131
+ wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_id ) );
132
+ }
133
+ exit;
 
 
 
 
 
 
 
134
 
135
+ } else {
136
+ $post_type_obj = get_post_type_object( $post->post_type );
137
+ wp_die(esc_attr(__('Copy creation failed, could not find original:', DUPLICATE_POST_I18N_DOMAIN)) . ' ' . $id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  }
 
139
  }
140
 
141
  /**
155
  }
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  /**
159
  * Get a post from the database
160
  */
161
  function duplicate_post_get_post($id) {
162
  global $wpdb;
163
  $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
164
+ if ($post[0]->post_type == "revision"){
165
+ $id = $post[0]->post_parent;
166
  $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$id");
167
  }
168
  return $post[0];
174
  function duplicate_post_copy_post_taxonomies($id, $new_id, $post_type) {
175
  global $wpdb;
176
  if (isset($wpdb->terms)) {
 
177
  $taxonomies = get_object_taxonomies($post_type); //array("category", "post_tag");
178
+ $taxonomies_blacklist = get_option('duplicate_post_taxonomies_blacklist');
179
+ if ($taxonomies_blacklist == "") $taxonomies_blacklist = array();
180
  foreach ($taxonomies as $taxonomy) {
181
+ if(!empty($taxonomies_blacklist) && in_array($taxonomy,$taxonomies_blacklist)) continue;
182
  $post_terms = wp_get_object_terms($id, $taxonomy);
183
  for ($i=0; $i<count($post_terms); $i++) {
184
  wp_set_object_terms($new_id, $post_terms[$i]->slug, $taxonomy, true);
212
  /**
213
  * Create a duplicate from a post
214
  */
215
+ function duplicate_post_create_duplicate($post, $status = '') {
216
  global $wpdb;
217
  //$new_post_type = 'post';
218
  $new_post_author = duplicate_post_get_current_user();
219
  $new_post_date = (get_option('duplicate_post_copydate') == 1)? $post->post_date : current_time('mysql');
220
  $new_post_date_gmt = get_gmt_from_date($new_post_date);
221
  $prefix = get_option('duplicate_post_title_prefix');
222
+ $suffix = get_option('duplicate_post_title_suffix');
223
  if (!empty($prefix)) $prefix.= " ";
224
+ if (!empty($prefix)) $suffix = " ".$suffix;
225
 
226
  $new_post_type = $post->post_type;
227
  $post_content = str_replace("'", "''", $post->post_content);
228
  $post_content_filtered = str_replace("'", "''", $post->post_content_filtered);
229
+ if (get_option('duplicate_post_copyexcerpt') == '1')
230
+ $post_excerpt = str_replace("'", "''", $post->post_excerpt);
231
+ else
232
+ $post_excerpt = "";
233
+ $post_title = $prefix.str_replace("'", "''", $post->post_title).$suffix;
234
+ if (empty($status))
235
+ $new_post_status = str_replace("'", "''", $post->post_status);
236
+ else
237
+ $new_post_status = $status;
238
+ $post_name = sanitize_title($post_title);
239
  $comment_status = str_replace("'", "''", $post->comment_status);
240
  $ping_status = str_replace("'", "''", $post->ping_status);
241
 
242
  // Insert the new template in the post table
243
  $wpdb->query(
244
  "INSERT INTO $wpdb->posts
245
+ (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, post_name)
246
  VALUES
247
+ ('$new_post_author->ID', '$new_post_date', '$new_post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$new_post_status', '$new_post_type', '$comment_status', '$ping_status', '$post->post_password', '$post->to_ping', '$post->pinged', '$new_post_date', '$new_post_date_gmt', '$post->post_parent', '$post->menu_order', '$post->post_mime_type', '$post_name')");
248
 
249
  $new_post_id = $wpdb->insert_id;
250
 
251
+ $post_name = wp_unique_post_slug($post_name, $new_post_id, $new_post_status, $new_post_type, $post->post_parent);
252
+ // Update post 37
253
+ $new_post = array();
254
+ $new_post['ID'] = $new_post_id;
255
+ $new_post['post_name'] = $post_name;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
 
257
+ // Update the post into the database
258
+ wp_update_post( $new_post );
 
 
 
 
259
 
 
260
 
261
  // Copy the taxonomies
262
+ duplicate_post_copy_post_taxonomies($post->ID, $new_post_id, $post->post_type);
263
 
264
  // Copy the meta information
265
+ duplicate_post_copy_post_meta_info($post->ID, $new_post_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
 
267
+ add_post_meta($new_post_id, '_dp_original', $post->ID);
268
 
269
+ // If you have written a plugin which uses non-WP database tables to save
270
+ // information about a post you can hook this action to dupe that data.
271
+ if ($post->post_type == 'page' || (function_exists(is_post_type_hierarchical) && is_post_type_hierarchical( $post->post_type )))
272
+ do_action( 'dp_duplicate_page', $new_id, $post );
273
+ else
274
+ do_action( 'dp_duplicate_post', $new_id, $post );
275
 
276
+ return $new_post_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
 
279
  //Add some links on the plugin page
280
  add_filter('plugin_row_meta', 'duplicate_post_add_plugin_links', 10, 2);
281
 
282
  function duplicate_post_add_plugin_links($links, $file) {
283
+ if ( $file == plugin_basename(dirname(__FILE__).'/duplicate-post.php') ) {
284
+ $links[] = '<a href="http://lopo.it/duplicate-post-plugin">' . __('Donate', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
285
+ $links[] = '<a href="http://lopo.it/duplicate-post-plugin">' . __('Translate', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
286
  }
287
  return $links;
288
  }
duplicate-post-common.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Test if the user is allowed to copy posts
5
+ */
6
+ function duplicate_post_is_current_user_allowed_to_copy() {
7
+ return current_user_can("level_" . duplicate_post_get_copy_user_level());
8
+ }
9
+
10
+ /**
11
+ * Wrapper for the option 'duplicate_post_create_user_level'
12
+ */
13
+ function duplicate_post_get_copy_user_level() {
14
+ return get_option( 'duplicate_post_copy_user_level' );
15
+ }
16
+
17
+ // Template tag
18
+ /**
19
+ * Retrieve duplicate post link for post.
20
+ *
21
+ * Can be used within the WordPress loop or outside of it. Can be used with
22
+ * pages, posts, attachments, and revisions.
23
+ *
24
+ *
25
+ * @param int $id Optional. Post ID.
26
+ * @param string $context Optional, default to display. How to write the '&', defaults to '&amp;'.
27
+ * @return string
28
+ */
29
+ function duplicate_post_get_clone_post_link( $id = 0, $context = 'display' ) {
30
+ if ( !duplicate_post_is_current_user_allowed_to_copy() )
31
+ return;
32
+
33
+ if ( !$post = &get_post( $id ) )
34
+ return;
35
+
36
+ if ( 'display' == $context )
37
+ $action = '?action=duplicate_post_save_as_new_post_draft&amp;post='.$post->ID;
38
+ else
39
+ $action = '?action=duplicate_post_save_as_new_post_draft&post='.$post->ID;
40
+
41
+ $post_type_object = get_post_type_object( $post->post_type );
42
+ if ( !$post_type_object )
43
+ return;
44
+
45
+ return apply_filters( 'duplicate_post_get_clone_post_link', admin_url( "admin.php". $action ), $post->ID, $context );
46
+ }
47
+ /**
48
+ * Display duplicate post link for post.
49
+ *
50
+ * @param string $link Optional. Anchor text.
51
+ * @param string $before Optional. Display before edit link.
52
+ * @param string $after Optional. Display after edit link.
53
+ * @param int $id Optional. Post ID.
54
+ */
55
+ function duplicate_post_clone_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
56
+ if ( !$post = &get_post( $id ) )
57
+ return;
58
+
59
+ if ( !$url = duplicate_post_get_clone_post_link( $post->ID ) )
60
+ return;
61
+
62
+ if ( null === $link )
63
+ $link = __('Clone', DUPLICATE_POST_I18N_DOMAIN);
64
+
65
+ $post_type_obj = get_post_type_object( $post->post_type );
66
+ $link = '<a class="post-clone-link" href="' . $url . '" title="'
67
+ . esc_attr(__("Clone this item", DUPLICATE_POST_I18N_DOMAIN))
68
+ .'">' . $link . '</a>';
69
+ echo $before . apply_filters( 'duplicate_post_clone_post_link', $link, $post->ID ) . $after;
70
+ }
71
+
72
+ ?>
duplicate-post-options.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Add an option page
4
+ */
5
+ if ( is_admin() ){ // admin actions
6
+ add_action('admin_menu', 'duplicate_post_menu');
7
+ add_action( 'admin_init', 'duplicate_post_register_settings');
8
+ }
9
+
10
+ function duplicate_post_register_settings() { // whitelist options
11
+ register_setting( 'duplicate_post_group', 'duplicate_post_copydate');
12
+ register_setting( 'duplicate_post_group', 'duplicate_post_copyexcerpt');
13
+ register_setting( 'duplicate_post_group', 'duplicate_post_blacklist');
14
+ register_setting( 'duplicate_post_group', 'duplicate_post_taxonomies_blacklist');
15
+ register_setting( 'duplicate_post_group', 'duplicate_post_title_prefix');
16
+ register_setting( 'duplicate_post_group', 'duplicate_post_title_suffix');
17
+ register_setting( 'duplicate_post_group', 'duplicate_post_copy_user_level');
18
+ }
19
+
20
+
21
+ function duplicate_post_menu() {
22
+ add_options_page(__("Duplicate Post Options", DUPLICATE_POST_I18N_DOMAIN), __("Duplicate Post", DUPLICATE_POST_I18N_DOMAIN), 'administrator', 'duplicatepost', 'duplicate_post_options');
23
+ }
24
+
25
+ function duplicate_post_options() {
26
+ ?>
27
+ <div class="wrap">
28
+ <h2>
29
+ <?php _e("Duplicate Post", DUPLICATE_POST_I18N_DOMAIN); ?>
30
+ </h2>
31
+
32
+ <form method="post" action="options.php">
33
+ <?php settings_fields('duplicate_post_group'); ?>
34
+
35
+ <table class="form-table">
36
+
37
+ <tr valign="top">
38
+ <th scope="row"><?php _e("Copy post/page date also", DUPLICATE_POST_I18N_DOMAIN); ?>
39
+ </th>
40
+ <td><input type="checkbox" name="duplicate_post_copydate" value="1" <?php if(get_option('duplicate_post_copydate') == 1) echo 'checked="checked"'; ?>"/>
41
+ <span class="description"><?php _e("Normally, the new draft has publication date set to current time: check the box to copy the original post/page date", DUPLICATE_POST_I18N_DOMAIN); ?>
42
+ </span>
43
+ </td>
44
+ </tr>
45
+ <tr valign="top">
46
+ <th scope="row"><?php _e("Copy excerpt", DUPLICATE_POST_I18N_DOMAIN); ?>
47
+ </th>
48
+ <td><input type="checkbox" name="duplicate_post_copyexcerpt"
49
+ value="1" <?php if(get_option('duplicate_post_copyexcerpt') == 1) echo 'checked="checked"'; ?>"/>
50
+ <span class="description"><?php _e("Copy the excerpt from the original post/page", DUPLICATE_POST_I18N_DOMAIN); ?>
51
+ </span>
52
+ </td>
53
+ </tr>
54
+ <tr valign="top">
55
+ <th scope="row"><?php _e("Do not copy these fields", DUPLICATE_POST_I18N_DOMAIN); ?>
56
+ </th>
57
+ <td><input type="text" name="duplicate_post_blacklist"
58
+ value="<?php echo get_option('duplicate_post_blacklist'); ?>" /> <span
59
+ class="description"><?php _e("Comma-separated list of meta fields that must not be copied when cloning a post/page", DUPLICATE_POST_I18N_DOMAIN); ?>
60
+ </span>
61
+ </td>
62
+ </tr>
63
+ <tr valign="top">
64
+ <th scope="row"><?php _e("Do not copy these taxonomies", DUPLICATE_POST_I18N_DOMAIN); ?>
65
+ </th>
66
+ <td><div
67
+ style="height: 100px; width: 300px; padding: 5px; overflow: auto; border: 1px solid #ccc">
68
+ <?php $taxonomies=get_taxonomies(array('public' => true),'objects');
69
+ $taxonomies_blacklist = get_option('duplicate_post_taxonomies_blacklist');
70
+ if ($taxonomies_blacklist == "") $taxonomies_blacklist = array();
71
+ foreach ($taxonomies as $taxonomy ) : ?>
72
+ <label style="display: block;"> <input type="checkbox"
73
+ name="duplicate_post_taxonomies_blacklist[]"
74
+ value="<?php echo $taxonomy->name?>"
75
+ <?php if(in_array($taxonomy->name,$taxonomies_blacklist)) echo 'checked="checked"'?> />
76
+ <?php echo $taxonomy->labels->name?> </label>
77
+ <?php endforeach; ?>
78
+ </div> <span class="description"><?php _e("Select the taxonomies you don't want to be copied", DUPLICATE_POST_I18N_DOMAIN); ?>
79
+ </span>
80
+ </td>
81
+ </tr>
82
+ <tr valign="top">
83
+ <th scope="row"><?php _e("Title prefix", DUPLICATE_POST_I18N_DOMAIN); ?>
84
+ </th>
85
+ <td><input type="text" name="duplicate_post_title_prefix"
86
+ value="<?php echo get_option('duplicate_post_title_prefix'); ?>" />
87
+ <span class="description"><?php _e("Prefix to be added before the original title when cloning a post/page, e.g. \"Copy of\" (blank for no prefix)", DUPLICATE_POST_I18N_DOMAIN); ?>
88
+ </span>
89
+ </td>
90
+ </tr>
91
+ <tr valign="top">
92
+ <th scope="row"><?php _e("Title suffix", DUPLICATE_POST_I18N_DOMAIN); ?>
93
+ </th>
94
+ <td><input type="text" name="duplicate_post_title_suffix"
95
+ value="<?php echo get_option('duplicate_post_title_suffix'); ?>" />
96
+ <span class="description"><?php _e("Suffix to be added after the original title when cloning a post/page, e.g. \"(dup)\" (blank for no suffix)", DUPLICATE_POST_I18N_DOMAIN); ?>
97
+ </span>
98
+ </td>
99
+ </tr>
100
+ <tr valign="top">
101
+ <th scope="row"><?php _e("Minimum level to copy posts", DUPLICATE_POST_I18N_DOMAIN); ?>
102
+ </th>
103
+ <td><select name="duplicate_post_copy_user_level">
104
+ <option value="8"
105
+ <?php if(get_option('duplicate_post_copy_user_level') == 8) echo 'selected="selected"'?>>
106
+ <?php echo _x("Administrator", "User role", "default")?>
107
+ </option>
108
+ <option value="5"
109
+ <?php if(get_option('duplicate_post_copy_user_level') == 5) echo 'selected="selected"'?>>
110
+ <?php echo _x("Editor", "User role", "default")?>
111
+ </option>
112
+ <option value="2"
113
+ <?php if(get_option('duplicate_post_copy_user_level') == 2) echo 'selected="selected"'?>>
114
+ <?php echo _x("Author", "User role", "default")?>
115
+ </option>
116
+ <option value="1"
117
+ <?php if(get_option('duplicate_post_copy_user_level') == 1) echo 'selected="selected"'?>>
118
+ <?php echo _x("Contributor", "User role", "default")?>
119
+ </option>
120
+ </select> <span class="description"><?php _e("Warning: users will be able to copy all posts, even those of higher level users", DUPLICATE_POST_I18N_DOMAIN); ?>
121
+ </span>
122
+ </td>
123
+ </tr>
124
+
125
+ </table>
126
+
127
+ <p class="submit">
128
+ <input type="submit" class="button-primary"
129
+ value="<?php _e('Save Changes', DUPLICATE_POST_I18N_DOMAIN) ?>" />
130
+ </p>
131
+
132
+ </form>
133
+ </div>
134
+ <?php
135
+ }
136
+ ?>
duplicate-post.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Duplicate Post
4
- Plugin URI: http://www.lopo.it/duplicate-post-plugin/
5
  Description: Creates a copy of a post.
6
- Version: 1.1.2
7
  Author: Enrico Battocchi
8
- Author URI: http://www.lopo.it
9
  Text Domain: duplicate-post
10
  */
11
 
@@ -26,8 +26,18 @@ along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  if (is_admin()){
31
- require_once (dirname(__FILE__).'/duplicate-post-admin.php');
32
  }
33
- ?>
1
  <?php
2
  /*
3
  Plugin Name: Duplicate Post
4
+ Plugin URI: http://lopo.it/duplicate-post-plugin/
5
  Description: Creates a copy of a post.
6
+ Version: 2.0
7
  Author: Enrico Battocchi
8
+ Author URI: http://lopo.it
9
  Text Domain: duplicate-post
10
  */
11
 
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ // i18n plugin domain
30
+ define('DUPLICATE_POST_I18N_DOMAIN', 'duplicate-post');
31
+
32
+ /**
33
+ * Initialise the internationalisation domain
34
+ */
35
+ load_plugin_textdomain(DUPLICATE_POST_I18N_DOMAIN,
36
+ 'wp-content/plugins/duplicate-post/languages','duplicate-post/languages');
37
+
38
+ require_once (dirname(__FILE__).'/duplicate-post-common.php');
39
 
40
  if (is_admin()){
41
+ require_once (dirname(__FILE__).'/duplicate-post-admin.php');
42
  }
43
+ ?>
languages/duplicate-post-cs_CZ.mo CHANGED
Binary file
languages/duplicate-post-cs_CZ.po CHANGED
@@ -1,4 +1,4 @@
1
- # Italian translation for duplicate-post
2
  # Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
3
  # This file is distributed under the same license as the duplicate-post package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
@@ -7,121 +7,134 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: duplicate-post\n"
9
  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
- "POT-Creation-Date: 2010-05-21 10:01+0000\n"
11
- "PO-Revision-Date: 2010-10-21 21:19+0100\n"
12
- "Last-Translator: Peter Kahoun <kahi.cz@gmail.com>\n"
13
- "Language-Team: Peter Kahoun <kahi.cz@gmail.com>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
- "X-Launchpad-Export-Date: 2010-06-23 21:48+0000\n"
18
- "X-Generator: Launchpad (build Unknown)\n"
19
- "X-Poedit-Language: Czech\n"
20
- "X-Poedit-Country: CZECH REPUBLIC\n"
21
- "X-Poedit-SourceCharset: utf-8\n"
22
 
23
- #: duplicate-post.php:39
24
- msgid "No post to duplicate has been supplied!"
25
- msgstr "Nebyl poskytnut příspěvek k duplikování!"
26
-
27
- #: duplicate-post.php:58
28
- #: duplicate-post.php:86
29
- msgid "Post creation failed, could not find original post:"
30
- msgstr "Nepodařilo se vytvořit příspěvek, protože nebyl nalezen originál:"
31
 
32
- #: duplicate-post.php:67
33
- msgid "No page to duplicate has been supplied!"
34
- msgstr "Nebyla poskytnuta stránka k duplikování!"
35
-
36
- #: duplicate-post.php:164
37
- #: duplicate-post.php:195
38
- msgid "Make a duplicate from this post"
39
- msgstr "Duplikovat tento příspěvek"
40
-
41
- #: duplicate-post.php:165
42
- #: duplicate-post.php:179
43
- #: duplicate-post.php:196
44
- #: duplicate-post.php:207
45
  msgid "Duplicate"
46
  msgstr "Duplikovat"
47
 
48
- #: duplicate-post.php:178
49
- #: duplicate-post.php:206
50
- msgid "Make a duplicate from this page"
51
- msgstr "Duplikovat tuto stránku"
52
-
53
- #: duplicate-post.php:225
54
  msgid "Copy to a new draft"
55
  msgstr "Duplikovat"
56
 
57
- #: duplicate-post.php:519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  msgid "Duplicate Post Options"
59
  msgstr "Možnosti duplikace příspěvku"
60
 
61
- #. #-#-#-#-# plugin.pot (Duplicate Post 1.1) #-#-#-#-#
62
  #. Plugin Name of the plugin/theme
63
- #: duplicate-post.php:519
64
- #: duplicate-post.php:525
65
  msgid "Duplicate Post"
66
  msgstr "Duplikování"
67
 
68
- #: duplicate-post.php:532
69
  msgid "Copy post/page date also"
70
  msgstr "Kopírovat i čas publikování"
71
 
72
- #: duplicate-post.php:534
73
- msgid "Normally, the new draft has publication date set to current time: check the box to copy the original post/page date"
74
- msgstr "Nezatrhnuto znamená, že datum publikování duplikátu je vždy nastaveno na aktuální čas."
 
 
 
 
75
 
76
- #: duplicate-post.php:538
 
 
 
 
 
 
 
 
77
  msgid "Do not copy these fields"
78
  msgstr "Nekopírovat tyto uživatelská pole"
79
 
80
- #: duplicate-post.php:541
81
- msgid "Comma-separated list of meta fields that must not be copied when cloning a post/page"
 
 
82
  msgstr "Jména polí oddělte čárkou"
83
 
84
- #: duplicate-post.php:545
 
 
 
 
 
 
 
 
85
  msgid "Title prefix"
86
  msgstr "Prefix titulku"
87
 
88
- #: duplicate-post.php:548
89
- msgid "Prefix to be added before the original title when cloning a post/page, e.g. \"Copy of\" (blank for no prefix)"
90
- msgstr "Text přidávaný kopii na začátek názvu. (Můžete nechat prázdné, anebo zadat např. \"Kopie\" .)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
- #: duplicate-post.php:552
93
  msgid "Minimum level to copy posts"
94
  msgstr "Minimální úroveň uživatele"
95
 
96
- #: duplicate-post.php:576
97
- msgid "Warning: users will be able to copy all posts, even those of higher level users"
98
- msgstr "Pozor! Uživatelé budou moci kopírovat všechny příspěvky, včetně příspěvků uživatelů vyšší úrovně"
 
 
 
 
99
 
100
- #: duplicate-post.php:583
101
  msgid "Save Changes"
102
  msgstr "Uložit změny"
103
 
104
- #: duplicate-post.php:595
105
- msgid "Donate"
106
- msgstr "Přispět"
107
-
108
- #: duplicate-post.php:596
109
- msgid "Translate"
110
- msgstr "Přeložit"
111
-
112
- #. Plugin URI of the plugin/theme
113
- msgid "http://www.lopo.it/duplicate-post-plugin/"
114
- msgstr "http://www.lopo.it/duplicate-post-plugin/"
115
 
116
  #. Description of the plugin/theme
117
  msgid "Creates a copy of a post."
118
  msgstr "Vytvoří kopii příspěvku."
119
-
120
- #. Author of the plugin/theme
121
- msgid "Enrico Battocchi"
122
- msgstr "Enrico Battocchi"
123
-
124
- #. Author URI of the plugin/theme
125
- msgid "http://www.lopo.it"
126
- msgstr "http://www.lopo.it"
127
-
1
+ # Czech translation for duplicate-post
2
  # Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
3
  # This file is distributed under the same license as the duplicate-post package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
7
  msgstr ""
8
  "Project-Id-Version: duplicate-post\n"
9
  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "POT-Creation-Date: 2011-11-11 13:14+0000\n"
11
+ "PO-Revision-Date: 2011-12-02 16:29+0000\n"
12
+ "Last-Translator: František Zatloukal <Unknown>\n"
13
+ "Language-Team: Czech <cs@li.org>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Launchpad-Export-Date: 2011-12-07 15:04+0000\n"
18
+ "X-Generator: Launchpad (build 14443)\n"
 
 
 
19
 
20
+ #: duplicate-post-admin.php:78 duplicate-post-common.php:67
21
+ msgid "Clone this item"
22
+ msgstr "Klonovat tuto položku"
 
 
 
 
 
23
 
24
+ #: duplicate-post-admin.php:79
 
 
 
 
 
 
 
 
 
 
 
 
25
  msgid "Duplicate"
26
  msgstr "Duplikovat"
27
 
28
+ #: duplicate-post-admin.php:97
 
 
 
 
 
29
  msgid "Copy to a new draft"
30
  msgstr "Duplikovat"
31
 
32
+ #: duplicate-post-admin.php:124
33
+ msgid "No post to duplicate has been supplied!"
34
+ msgstr "Nebyl poskytnut příspěvek k duplikování!"
35
+
36
+ #: duplicate-post-admin.php:146
37
+ msgid "Copy creation failed, could not find original:"
38
+ msgstr "Vytvoření kopie selhalo, nemohu nalézt originál:"
39
+
40
+ #: duplicate-post-admin.php:293
41
+ msgid "Donate"
42
+ msgstr "Přispět"
43
+
44
+ #: duplicate-post-admin.php:294
45
+ msgid "Translate"
46
+ msgstr "Přeložit"
47
+
48
+ #: duplicate-post-options.php:22
49
  msgid "Duplicate Post Options"
50
  msgstr "Možnosti duplikace příspěvku"
51
 
52
+ #. #-#-#-#-# plugin.pot (Duplicate Post 2.0) #-#-#-#-#
53
  #. Plugin Name of the plugin/theme
54
+ #: duplicate-post-options.php:22 duplicate-post-options.php:29
 
55
  msgid "Duplicate Post"
56
  msgstr "Duplikování"
57
 
58
+ #: duplicate-post-options.php:38
59
  msgid "Copy post/page date also"
60
  msgstr "Kopírovat i čas publikování"
61
 
62
+ #: duplicate-post-options.php:41
63
+ msgid ""
64
+ "Normally, the new draft has publication date set to current time: check the "
65
+ "box to copy the original post/page date"
66
+ msgstr ""
67
+ "Nezatrhnuto znamená, že datum publikování duplikátu je vždy nastaveno na "
68
+ "aktuální čas."
69
 
70
+ #: duplicate-post-options.php:46
71
+ msgid "Copy excerpt"
72
+ msgstr ""
73
+
74
+ #: duplicate-post-options.php:50
75
+ msgid "Copy the excerpt from the original post/page"
76
+ msgstr ""
77
+
78
+ #: duplicate-post-options.php:55
79
  msgid "Do not copy these fields"
80
  msgstr "Nekopírovat tyto uživatelská pole"
81
 
82
+ #: duplicate-post-options.php:59
83
+ msgid ""
84
+ "Comma-separated list of meta fields that must not be copied when cloning a "
85
+ "post/page"
86
  msgstr "Jména polí oddělte čárkou"
87
 
88
+ #: duplicate-post-options.php:64
89
+ msgid "Do not copy these taxonomies"
90
+ msgstr ""
91
+
92
+ #: duplicate-post-options.php:78
93
+ msgid "Select the taxonomies you don't want to be copied"
94
+ msgstr ""
95
+
96
+ #: duplicate-post-options.php:83
97
  msgid "Title prefix"
98
  msgstr "Prefix titulku"
99
 
100
+ #: duplicate-post-options.php:87
101
+ msgid ""
102
+ "Prefix to be added before the original title when cloning a post/page, e.g. "
103
+ "\"Copy of\" (blank for no prefix)"
104
+ msgstr ""
105
+ "Text přidávaný kopii na začátek názvu. (Můžete nechat prázdné, anebo zadat "
106
+ "např. \\\"Kopie\\\" .)"
107
+
108
+ #: duplicate-post-options.php:92
109
+ msgid "Title suffix"
110
+ msgstr ""
111
+
112
+ #: duplicate-post-options.php:96
113
+ msgid ""
114
+ "Suffix to be added after the original title when cloning a post/page, e.g. "
115
+ "\"(dup)\" (blank for no suffix)"
116
+ msgstr ""
117
 
118
+ #: duplicate-post-options.php:101
119
  msgid "Minimum level to copy posts"
120
  msgstr "Minimální úroveň uživatele"
121
 
122
+ #: duplicate-post-options.php:120
123
+ msgid ""
124
+ "Warning: users will be able to copy all posts, even those of higher level "
125
+ "users"
126
+ msgstr ""
127
+ "Pozor! Uživatelé budou moci kopírovat všechny příspěvky, včetně příspěvků "
128
+ "uživatelů vyšší úrovně"
129
 
130
+ #: duplicate-post-options.php:129
131
  msgid "Save Changes"
132
  msgstr "Uložit změny"
133
 
134
+ #: duplicate-post-common.php:63
135
+ msgid "Clone"
136
+ msgstr ""
 
 
 
 
 
 
 
 
137
 
138
  #. Description of the plugin/theme
139
  msgid "Creates a copy of a post."
140
  msgstr "Vytvoří kopii příspěvku."
 
 
 
 
 
 
 
 
 
languages/duplicate-post-es.mo ADDED
Binary file
languages/duplicate-post-es.po ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Spanish translation for duplicate-post
2
+ # Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
3
+ # This file is distributed under the same license as the duplicate-post package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: duplicate-post\n"
9
+ "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "POT-Creation-Date: 2011-11-11 13:14+0000\n"
11
+ "PO-Revision-Date: 2011-12-05 00:27+0000\n"
12
+ "Last-Translator: Enrico Battocchi <Unknown>\n"
13
+ "Language-Team: Spanish <es@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Launchpad-Export-Date: 2011-12-07 15:04+0000\n"
18
+ "X-Generator: Launchpad (build 14443)\n"
19
+
20
+ #: duplicate-post-admin.php:78 duplicate-post-common.php:67
21
+ msgid "Clone this item"
22
+ msgstr ""
23
+
24
+ #: duplicate-post-admin.php:79
25
+ msgid "Duplicate"
26
+ msgstr "Duplicar"
27
+
28
+ #: duplicate-post-admin.php:97
29
+ msgid "Copy to a new draft"
30
+ msgstr "Copia en un borrador nuevo"
31
+
32
+ #: duplicate-post-admin.php:124
33
+ msgid "No post to duplicate has been supplied!"
34
+ msgstr "No se facilitó ninguna entrada a copiar"
35
+
36
+ #: duplicate-post-admin.php:146
37
+ msgid "Copy creation failed, could not find original:"
38
+ msgstr ""
39
+
40
+ #: duplicate-post-admin.php:293
41
+ msgid "Donate"
42
+ msgstr "Hacer una donación"
43
+
44
+ #: duplicate-post-admin.php:294
45
+ msgid "Translate"
46
+ msgstr "Traducir"
47
+
48
+ #: duplicate-post-options.php:22
49
+ msgid "Duplicate Post Options"
50
+ msgstr "Opciones de Duplicate Post"
51
+
52
+ #. #-#-#-#-# plugin.pot (Duplicate Post 2.0) #-#-#-#-#
53
+ #. Plugin Name of the plugin/theme
54
+ #: duplicate-post-options.php:22 duplicate-post-options.php:29
55
+ msgid "Duplicate Post"
56
+ msgstr "Duplicate Post"
57
+
58
+ #: duplicate-post-options.php:38
59
+ msgid "Copy post/page date also"
60
+ msgstr "Copiar también fecha del post o la página"
61
+
62
+ #: duplicate-post-options.php:41
63
+ msgid ""
64
+ "Normally, the new draft has publication date set to current time: check the "
65
+ "box to copy the original post/page date"
66
+ msgstr ""
67
+ "Normalmente se establece la fecha de publicación del nuevo borrador a la "
68
+ "fecha actual: compruebe la casilla para copiar la fecha original del post o "
69
+ "la página"
70
+
71
+ #: duplicate-post-options.php:46
72
+ msgid "Copy excerpt"
73
+ msgstr ""
74
+
75
+ #: duplicate-post-options.php:50
76
+ msgid "Copy the excerpt from the original post/page"
77
+ msgstr ""
78
+
79
+ #: duplicate-post-options.php:55
80
+ msgid "Do not copy these fields"
81
+ msgstr "No copiar estos campos"
82
+
83
+ #: duplicate-post-options.php:59
84
+ msgid ""
85
+ "Comma-separated list of meta fields that must not be copied when cloning a "
86
+ "post/page"
87
+ msgstr ""
88
+ "Lista separada por comas de meta campos que no pueden ser copiados cuando se "
89
+ "clona una entrada/pagina."
90
+
91
+ #: duplicate-post-options.php:64
92
+ msgid "Do not copy these taxonomies"
93
+ msgstr ""
94
+
95
+ #: duplicate-post-options.php:78
96
+ msgid "Select the taxonomies you don't want to be copied"
97
+ msgstr ""
98
+
99
+ #: duplicate-post-options.php:83
100
+ msgid "Title prefix"
101
+ msgstr "Prefijo del titulo"
102
+
103
+ #: duplicate-post-options.php:87
104
+ msgid ""
105
+ "Prefix to be added before the original title when cloning a post/page, e.g. "
106
+ "\"Copy of\" (blank for no prefix)"
107
+ msgstr ""
108
+ "Prefijo a ser agregado antes del titulo original cuando se clona una "
109
+ "entrada/pagina, ej. \"Copia de\" (en blanco para no agregar prefijo)"
110
+
111
+ #: duplicate-post-options.php:92
112
+ msgid "Title suffix"
113
+ msgstr ""
114
+
115
+ #: duplicate-post-options.php:96
116
+ msgid ""
117
+ "Suffix to be added after the original title when cloning a post/page, e.g. "
118
+ "\"(dup)\" (blank for no suffix)"
119
+ msgstr ""
120
+
121
+ #: duplicate-post-options.php:101
122
+ msgid "Minimum level to copy posts"
123
+ msgstr "Nivel mínimo para copiar posts"
124
+
125
+ #: duplicate-post-options.php:120
126
+ msgid ""
127
+ "Warning: users will be able to copy all posts, even those of higher level "
128
+ "users"
129
+ msgstr ""
130
+ "Atención: los usuarios podrán copiar todos los posts, incluso aquellos de "
131
+ "usuarios de nivel más alto"
132
+
133
+ #: duplicate-post-options.php:129
134
+ msgid "Save Changes"
135
+ msgstr "Guardar los cambios"
136
+
137
+ #: duplicate-post-common.php:63
138
+ msgid "Clone"
139
+ msgstr ""
140
+
141
+ #. Description of the plugin/theme
142
+ msgid "Creates a copy of a post."
143
+ msgstr "Crear una copia de las entradas."
languages/duplicate-post-it_IT.mo CHANGED
Binary file
languages/duplicate-post-it_IT.po CHANGED
@@ -7,130 +7,143 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: duplicate-post\n"
9
  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
- "POT-Creation-Date: 2010-05-21 10:01+0000\n"
11
- "PO-Revision-Date: 2010-05-21 10:30+0000\n"
12
- "Last-Translator: Enrico Battocchi <Unknown>\n"
13
  "Language-Team: Italian <it@li.org>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
- "X-Launchpad-Export-Date: 2010-06-23 21:48+0000\n"
18
- "X-Generator: Launchpad (build Unknown)\n"
19
 
20
- #: duplicate-post.php:39
21
- msgid "No post to duplicate has been supplied!"
22
- msgstr "Non è stato fornito alcun articolo da copiare!"
23
-
24
- #: duplicate-post.php:58 duplicate-post.php:86
25
- msgid "Post creation failed, could not find original post:"
26
- msgstr ""
27
- "Creazione dell'articolo fallita, non è stato possibile trovare l'articolo "
28
- "originale:"
29
-
30
- #: duplicate-post.php:67
31
- msgid "No page to duplicate has been supplied!"
32
- msgstr "Non è stata fornita alcuna pagina da copiare!"
33
-
34
- #: duplicate-post.php:164 duplicate-post.php:195
35
- msgid "Make a duplicate from this post"
36
- msgstr "Crea una copia di questo articolo"
37
 
38
- #: duplicate-post.php:165 duplicate-post.php:179 duplicate-post.php:196
39
- #: duplicate-post.php:207
40
  msgid "Duplicate"
41
  msgstr "Duplica"
42
 
43
- #: duplicate-post.php:178 duplicate-post.php:206
44
- msgid "Make a duplicate from this page"
45
- msgstr "Crea una copia di questa pagina"
46
-
47
- #: duplicate-post.php:225
48
  msgid "Copy to a new draft"
49
  msgstr "Copia in una nuova bozza"
50
 
51
- #: duplicate-post.php:519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  msgid "Duplicate Post Options"
53
  msgstr "Opzioni di Duplicate Post"
54
 
55
- #. #-#-#-#-# plugin.pot (Duplicate Post 1.1) #-#-#-#-#
56
  #. Plugin Name of the plugin/theme
57
- #: duplicate-post.php:519 duplicate-post.php:525
 
58
  msgid "Duplicate Post"
59
  msgstr "Duplicate Post"
60
 
61
- #: duplicate-post.php:532
62
  msgid "Copy post/page date also"
63
  msgstr "Copia anche la data dell'articolo o pagina"
64
 
65
- #: duplicate-post.php:534
66
- msgid ""
67
- "Normally, the new draft has publication date set to current time: check the "
68
- "box to copy the original post/page date"
69
- msgstr ""
70
- "Normalmente, la nuova bozza ha la data di pubblicazione impostata "
71
- "all'istante corrente: spunta la casella per copiare la data "
72
- "dell'articolo/pagina originale"
 
 
 
73
 
74
- #: duplicate-post.php:538
75
  msgid "Do not copy these fields"
76
  msgstr "Non copiare questi campi"
77
 
78
- #: duplicate-post.php:541
79
- msgid ""
80
- "Comma-separated list of meta fields that must not be copied when cloning a "
81
- "post/page"
82
- msgstr ""
83
- "Lista separata da virgole di campi personalizzati da non copiare quando "
84
- "viene clonato un post o una pagina"
85
 
86
- #: duplicate-post.php:545
 
 
 
 
87
  msgid "Title prefix"
88
  msgstr "Prefisso del titolo"
89
 
90
- #: duplicate-post.php:548
91
- msgid ""
92
- "Prefix to be added before the original title when cloning a post/page, e.g. "
93
- "\"Copy of\" (blank for no prefix)"
94
- msgstr ""
95
- "Prefisso da aggiungere prima del titolo originale quando si clona un post o "
96
- "una pagina, es. \"Copia di\" (lasciare vuoto per nessun prefisso)"
97
 
98
- #: duplicate-post.php:552
 
 
 
 
 
 
 
 
99
  msgid "Minimum level to copy posts"
100
  msgstr "Livello minimo per copiare gli articoli"
101
 
102
- #: duplicate-post.php:576
103
- msgid ""
104
- "Warning: users will be able to copy all posts, even those of higher level "
105
- "users"
106
- msgstr ""
107
- "Attenzione: gli utenti potranno copiare tutti gli articoli, anche quelli "
108
- "degli utenti di livello superiore"
109
 
110
- #: duplicate-post.php:583
111
  msgid "Save Changes"
112
  msgstr "Salva le modifiche"
113
 
114
- #: duplicate-post.php:595
115
- msgid "Donate"
116
- msgstr "Invia una donazione"
117
-
118
- #: duplicate-post.php:596
119
- msgid "Translate"
120
- msgstr "Traduci"
121
-
122
- #. Plugin URI of the plugin/theme
123
- msgid "http://www.lopo.it/duplicate-post-plugin/"
124
- msgstr "http://www.lopo.it/duplicate-post-plugin/"
125
 
126
  #. Description of the plugin/theme
127
  msgid "Creates a copy of a post."
128
  msgstr "Crea una copia di un articolo."
129
 
130
- #. Author of the plugin/theme
131
- msgid "Enrico Battocchi"
132
- msgstr "Enrico Battocchi"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
- #. Author URI of the plugin/theme
135
- msgid "http://www.lopo.it"
136
- msgstr "http://www.lopo.it"
7
  msgstr ""
8
  "Project-Id-Version: duplicate-post\n"
9
  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "POT-Creation-Date: 2011-11-11 13:14+0000\n"
11
+ "PO-Revision-Date: 2011-11-11 14:49+0100\n"
12
+ "Last-Translator: Enrico Battocchi <enrico.battocchi@gmail.com>\n"
13
  "Language-Team: Italian <it@li.org>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Launchpad-Export-Date: 2011-11-11 13:48+0000\n"
18
+ "X-Generator: Launchpad (build 14277)\n"
19
 
20
+ #: duplicate-post-admin.php:78
21
+ #: duplicate-post-common.php:67
22
+ msgid "Clone this item"
23
+ msgstr "Clona questo elemento"
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
+ #: duplicate-post-admin.php:79
 
26
  msgid "Duplicate"
27
  msgstr "Duplica"
28
 
29
+ #: duplicate-post-admin.php:97
 
 
 
 
30
  msgid "Copy to a new draft"
31
  msgstr "Copia in una nuova bozza"
32
 
33
+ #: duplicate-post-admin.php:124
34
+ msgid "No post to duplicate has been supplied!"
35
+ msgstr "Non è stato fornito alcun articolo da copiare!"
36
+
37
+ #: duplicate-post-admin.php:146
38
+ msgid "Copy creation failed, could not find original:"
39
+ msgstr "Creazione della copia fallita, impossibile trovare l'originale:"
40
+
41
+ #: duplicate-post-admin.php:293
42
+ msgid "Donate"
43
+ msgstr "Invia una donazione"
44
+
45
+ #: duplicate-post-admin.php:294
46
+ msgid "Translate"
47
+ msgstr "Traduci"
48
+
49
+ #: duplicate-post-options.php:22
50
  msgid "Duplicate Post Options"
51
  msgstr "Opzioni di Duplicate Post"
52
 
53
+ #. #-#-#-#-# plugin.pot (Duplicate Post 2.0) #-#-#-#-#
54
  #. Plugin Name of the plugin/theme
55
+ #: duplicate-post-options.php:22
56
+ #: duplicate-post-options.php:29
57
  msgid "Duplicate Post"
58
  msgstr "Duplicate Post"
59
 
60
+ #: duplicate-post-options.php:38
61
  msgid "Copy post/page date also"
62
  msgstr "Copia anche la data dell'articolo o pagina"
63
 
64
+ #: duplicate-post-options.php:41
65
+ msgid "Normally, the new draft has publication date set to current time: check the box to copy the original post/page date"
66
+ msgstr "Normalmente, la nuova bozza ha la data di pubblicazione impostata all'istante corrente: spunta la casella per copiare la data dell'articolo/pagina originale"
67
+
68
+ #: duplicate-post-options.php:46
69
+ msgid "Copy excerpt"
70
+ msgstr "Copia il riassunto"
71
+
72
+ #: duplicate-post-options.php:50
73
+ msgid "Copy the excerpt from the original post/page"
74
+ msgstr "Copia il riassunto dall'articolo o pagina originale"
75
 
76
+ #: duplicate-post-options.php:55
77
  msgid "Do not copy these fields"
78
  msgstr "Non copiare questi campi"
79
 
80
+ #: duplicate-post-options.php:59
81
+ msgid "Comma-separated list of meta fields that must not be copied when cloning a post/page"
82
+ msgstr "Lista separata da virgole di campi personalizzati da non copiare quando viene clonato un post o una pagina"
83
+
84
+ #: duplicate-post-options.php:64
85
+ msgid "Do not copy these taxonomies"
86
+ msgstr "Non copiare queste tassonomie"
87
 
88
+ #: duplicate-post-options.php:78
89
+ msgid "Select the taxonomies you don't want to be copied"
90
+ msgstr "Seleziona le tassonomie che non vuoi copiare"
91
+
92
+ #: duplicate-post-options.php:83
93
  msgid "Title prefix"
94
  msgstr "Prefisso del titolo"
95
 
96
+ #: duplicate-post-options.php:87
97
+ msgid "Prefix to be added before the original title when cloning a post/page, e.g. \"Copy of\" (blank for no prefix)"
98
+ msgstr "Prefisso da aggiungere prima del titolo originale quando si clona un post o una pagina, es. \"Copia di\" (lasciare vuoto per nessun prefisso)"
 
 
 
 
99
 
100
+ #: duplicate-post-options.php:92
101
+ msgid "Title suffix"
102
+ msgstr "Suffisso del titolo"
103
+
104
+ #: duplicate-post-options.php:96
105
+ msgid "Suffix to be added after the original title when cloning a post/page, e.g. \"(dup)\" (blank for no suffix)"
106
+ msgstr "Suffisso da aggiungere prima del titolo originale quando si clona un post o una pagina, es. \"(copia)\" (lasciare vuoto per nessun suffisso)"
107
+
108
+ #: duplicate-post-options.php:101
109
  msgid "Minimum level to copy posts"
110
  msgstr "Livello minimo per copiare gli articoli"
111
 
112
+ #: duplicate-post-options.php:120
113
+ msgid "Warning: users will be able to copy all posts, even those of higher level users"
114
+ msgstr "Attenzione: gli utenti potranno copiare tutti gli articoli, anche quelli degli utenti di livello superiore"
 
 
 
 
115
 
116
+ #: duplicate-post-options.php:129
117
  msgid "Save Changes"
118
  msgstr "Salva le modifiche"
119
 
120
+ #: duplicate-post-common.php:63
121
+ msgid "Clone"
122
+ msgstr "Clona"
 
 
 
 
 
 
 
 
123
 
124
  #. Description of the plugin/theme
125
  msgid "Creates a copy of a post."
126
  msgstr "Crea una copia di un articolo."
127
 
128
+ #~ msgid "No page to duplicate has been supplied!"
129
+ #~ msgstr "Non è stata fornita alcuna pagina da copiare!"
130
+
131
+ #~ msgid "Make a duplicate from this post"
132
+ #~ msgstr "Crea una copia di questo articolo"
133
+
134
+ #~ msgid "Make a duplicate from this page"
135
+ #~ msgstr "Crea una copia di questa pagina"
136
+
137
+ #~ msgid "Post creation failed, could not find original post:"
138
+ #~ msgstr ""
139
+ #~ "Creazione dell'articolo fallita, non è stato possibile trovare l'articolo "
140
+ #~ "originale:"
141
+
142
+ #~ msgid "Enrico Battocchi"
143
+ #~ msgstr "Enrico Battocchi"
144
+
145
+ #~ msgid "http://www.lopo.it"
146
+ #~ msgstr "http://www.lopo.it"
147
 
148
+ #~ msgid "http://www.lopo.it/duplicate-post-plugin/"
149
+ #~ msgstr "http://www.lopo.it/duplicate-post-plugin/"
 
languages/duplicate-post-zh_CN.mo ADDED
Binary file
languages/duplicate-post-zh_CN.po ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Chinese (Simplified) translation for duplicate-post
2
+ # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
3
+ # This file is distributed under the same license as the duplicate-post package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: duplicate-post\n"
9
+ "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "POT-Creation-Date: 2011-11-11 13:14+0000\n"
11
+ "PO-Revision-Date: 2011-06-24 08:18+0000\n"
12
+ "Last-Translator: You Dang <Unknown>\n"
13
+ "Language-Team: Chinese (Simplified) <zh_CN@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Launchpad-Export-Date: 2011-12-07 15:04+0000\n"
18
+ "X-Generator: Launchpad (build 14443)\n"
19
+
20
+ #: duplicate-post-admin.php:78 duplicate-post-common.php:67
21
+ msgid "Clone this item"
22
+ msgstr ""
23
+
24
+ #: duplicate-post-admin.php:79
25
+ msgid "Duplicate"
26
+ msgstr "复制"
27
+
28
+ #: duplicate-post-admin.php:97
29
+ msgid "Copy to a new draft"
30
+ msgstr "复制到新草稿"
31
+
32
+ #: duplicate-post-admin.php:124
33
+ msgid "No post to duplicate has been supplied!"
34
+ msgstr ""
35
+
36
+ #: duplicate-post-admin.php:146
37
+ msgid "Copy creation failed, could not find original:"
38
+ msgstr ""
39
+
40
+ #: duplicate-post-admin.php:293
41
+ msgid "Donate"
42
+ msgstr "捐赠"
43
+
44
+ #: duplicate-post-admin.php:294
45
+ msgid "Translate"
46
+ msgstr "翻译"
47
+
48
+ #: duplicate-post-options.php:22
49
+ msgid "Duplicate Post Options"
50
+ msgstr "文章复制选项"
51
+
52
+ #. #-#-#-#-# plugin.pot (Duplicate Post 2.0) #-#-#-#-#
53
+ #. Plugin Name of the plugin/theme
54
+ #: duplicate-post-options.php:22 duplicate-post-options.php:29
55
+ msgid "Duplicate Post"
56
+ msgstr "文章复制"
57
+
58
+ #: duplicate-post-options.php:38
59
+ msgid "Copy post/page date also"
60
+ msgstr "同时复制文章/页面的日期"
61
+
62
+ #: duplicate-post-options.php:41
63
+ msgid ""
64
+ "Normally, the new draft has publication date set to current time: check the "
65
+ "box to copy the original post/page date"
66
+ msgstr "一般来说,新草稿会将发布日期设置成当前时间:勾选以复制原文章/页面日期"
67
+
68
+ #: duplicate-post-options.php:46
69
+ msgid "Copy excerpt"
70
+ msgstr ""
71
+
72
+ #: duplicate-post-options.php:50
73
+ msgid "Copy the excerpt from the original post/page"
74
+ msgstr ""
75
+
76
+ #: duplicate-post-options.php:55
77
+ msgid "Do not copy these fields"
78
+ msgstr "不要复制这些字段"
79
+
80
+ #: duplicate-post-options.php:59
81
+ msgid ""
82
+ "Comma-separated list of meta fields that must not be copied when cloning a "
83
+ "post/page"
84
+ msgstr "复制文章/页面时不应该被复制的逗号分隔的元字段列表"
85
+
86
+ #: duplicate-post-options.php:64
87
+ msgid "Do not copy these taxonomies"
88
+ msgstr ""
89
+
90
+ #: duplicate-post-options.php:78
91
+ msgid "Select the taxonomies you don't want to be copied"
92
+ msgstr ""
93
+
94
+ #: duplicate-post-options.php:83
95
+ msgid "Title prefix"
96
+ msgstr "标题前缀"
97
+
98
+ #: duplicate-post-options.php:87
99
+ msgid ""
100
+ "Prefix to be added before the original title when cloning a post/page, e.g. "
101
+ "\"Copy of\" (blank for no prefix)"
102
+ msgstr "复制文章/页面时前缀将被加到原标题的前面,例如“副本”(无前缀时将留白)"
103
+
104
+ #: duplicate-post-options.php:92
105
+ msgid "Title suffix"
106
+ msgstr ""
107
+
108
+ #: duplicate-post-options.php:96
109
+ msgid ""
110
+ "Suffix to be added after the original title when cloning a post/page, e.g. "
111
+ "\"(dup)\" (blank for no suffix)"
112
+ msgstr ""
113
+
114
+ #: duplicate-post-options.php:101
115
+ msgid "Minimum level to copy posts"
116
+ msgstr ""
117
+
118
+ #: duplicate-post-options.php:120
119
+ msgid ""
120
+ "Warning: users will be able to copy all posts, even those of higher level "
121
+ "users"
122
+ msgstr "警告:用户能复制所有的文章,包括那些高级别的用户"
123
+
124
+ #: duplicate-post-options.php:129
125
+ msgid "Save Changes"
126
+ msgstr "保存变更"
127
+
128
+ #: duplicate-post-common.php:63
129
+ msgid "Clone"
130
+ msgstr ""
131
+
132
+ #. Description of the plugin/theme
133
+ msgid "Creates a copy of a post."
134
+ msgstr "创建文章的副本"
languages/duplicate-post.pot CHANGED
@@ -1,121 +1,131 @@
1
- #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: Duplicate Post 1.1\n"
5
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/duplicate-post\n"
6
- "POT-Creation-Date: 2010-05-21 10:01+0000\n"
7
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
- "Language-Team: LANGUAGE <LL@li.org>\n"
10
  "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=utf-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Launchpad-Export-Date: 2010-06-23 21:48+0000\n"
14
- "X-Generator: Launchpad (build Unknown)\n"
 
15
 
16
- #: duplicate-post.php:39
17
- msgid "No post to duplicate has been supplied!"
18
  msgstr ""
19
 
20
- #: duplicate-post.php:58 duplicate-post.php:86
21
- msgid "Post creation failed, could not find original post:"
22
  msgstr ""
23
 
24
- #: duplicate-post.php:67
25
- msgid "No page to duplicate has been supplied!"
26
  msgstr ""
27
 
28
- #: duplicate-post.php:164 duplicate-post.php:195
29
- msgid "Make a duplicate from this post"
30
  msgstr ""
31
 
32
- #: duplicate-post.php:165 duplicate-post.php:179 duplicate-post.php:196
33
- #: duplicate-post.php:207
34
- msgid "Duplicate"
35
  msgstr ""
36
 
37
- #: duplicate-post.php:178 duplicate-post.php:206
38
- msgid "Make a duplicate from this page"
39
  msgstr ""
40
 
41
- #: duplicate-post.php:225
42
- msgid "Copy to a new draft"
43
  msgstr ""
44
 
45
- #: duplicate-post.php:519
46
  msgid "Duplicate Post Options"
47
  msgstr ""
48
 
49
- #. #-#-#-#-# plugin.pot (Duplicate Post 1.1) #-#-#-#-#
50
  #. Plugin Name of the plugin/theme
51
- #: duplicate-post.php:519 duplicate-post.php:525
52
  msgid "Duplicate Post"
53
  msgstr ""
54
 
55
- #: duplicate-post.php:532
56
  msgid "Copy post/page date also"
57
  msgstr ""
58
 
59
- #: duplicate-post.php:534
60
  msgid ""
61
  "Normally, the new draft has publication date set to current time: check the "
62
  "box to copy the original post/page date"
63
  msgstr ""
64
 
65
- #: duplicate-post.php:538
 
 
 
 
 
 
 
 
66
  msgid "Do not copy these fields"
67
  msgstr ""
68
 
69
- #: duplicate-post.php:541
70
  msgid ""
71
  "Comma-separated list of meta fields that must not be copied when cloning a "
72
  "post/page"
73
  msgstr ""
74
 
75
- #: duplicate-post.php:545
 
 
 
 
 
 
 
 
76
  msgid "Title prefix"
77
  msgstr ""
78
 
79
- #: duplicate-post.php:548
80
  msgid ""
81
  "Prefix to be added before the original title when cloning a post/page, e.g. "
82
  "\"Copy of\" (blank for no prefix)"
83
  msgstr ""
84
 
85
- #: duplicate-post.php:552
86
- msgid "Minimum level to copy posts"
87
  msgstr ""
88
 
89
- #: duplicate-post.php:576
90
  msgid ""
91
- "Warning: users will be able to copy all posts, even those of higher level "
92
- "users"
93
  msgstr ""
94
 
95
- #: duplicate-post.php:583
96
- msgid "Save Changes"
97
  msgstr ""
98
 
99
- #: duplicate-post.php:595
100
- msgid "Donate"
 
 
101
  msgstr ""
102
 
103
- #: duplicate-post.php:596
104
- msgid "Translate"
105
  msgstr ""
106
 
107
- #. Plugin URI of the plugin/theme
108
- msgid "http://www.lopo.it/duplicate-post-plugin/"
109
  msgstr ""
110
 
111
  #. Description of the plugin/theme
112
  msgid "Creates a copy of a post."
113
  msgstr ""
114
 
115
- #. Author of the plugin/theme
116
- msgid "Enrico Battocchi"
117
- msgstr ""
118
 
119
- #. Author URI of the plugin/theme
120
- msgid "http://www.lopo.it"
121
- msgstr ""
1
+ # Copyright (C) 2010 Duplicate Post
2
+ # This file is distributed under the same license as the Duplicate Post package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Duplicate Post 2.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/duplicate-post\n"
7
+ "POT-Creation-Date: 2011-11-11 13:14:50+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: duplicate-post-admin.php:78 duplicate-post-common.php:67
16
+ msgid "Clone this item"
17
  msgstr ""
18
 
19
+ #: duplicate-post-admin.php:79
20
+ msgid "Duplicate"
21
  msgstr ""
22
 
23
+ #: duplicate-post-admin.php:97
24
+ msgid "Copy to a new draft"
25
  msgstr ""
26
 
27
+ #: duplicate-post-admin.php:124
28
+ msgid "No post to duplicate has been supplied!"
29
  msgstr ""
30
 
31
+ #: duplicate-post-admin.php:146
32
+ msgid "Copy creation failed, could not find original:"
 
33
  msgstr ""
34
 
35
+ #: duplicate-post-admin.php:293
36
+ msgid "Donate"
37
  msgstr ""
38
 
39
+ #: duplicate-post-admin.php:294
40
+ msgid "Translate"
41
  msgstr ""
42
 
43
+ #: duplicate-post-options.php:22
44
  msgid "Duplicate Post Options"
45
  msgstr ""
46
 
47
+ #. #-#-#-#-# plugin.pot (Duplicate Post 2.0) #-#-#-#-#
48
  #. Plugin Name of the plugin/theme
49
+ #: duplicate-post-options.php:22 duplicate-post-options.php:29
50
  msgid "Duplicate Post"
51
  msgstr ""
52
 
53
+ #: duplicate-post-options.php:38
54
  msgid "Copy post/page date also"
55
  msgstr ""
56
 
57
+ #: duplicate-post-options.php:41
58
  msgid ""
59
  "Normally, the new draft has publication date set to current time: check the "
60
  "box to copy the original post/page date"
61
  msgstr ""
62
 
63
+ #: duplicate-post-options.php:46
64
+ msgid "Copy excerpt"
65
+ msgstr ""
66
+
67
+ #: duplicate-post-options.php:50
68
+ msgid "Copy the excerpt from the original post/page"
69
+ msgstr ""
70
+
71
+ #: duplicate-post-options.php:55
72
  msgid "Do not copy these fields"
73
  msgstr ""
74
 
75
+ #: duplicate-post-options.php:59
76
  msgid ""
77
  "Comma-separated list of meta fields that must not be copied when cloning a "
78
  "post/page"
79
  msgstr ""
80
 
81
+ #: duplicate-post-options.php:64
82
+ msgid "Do not copy these taxonomies"
83
+ msgstr ""
84
+
85
+ #: duplicate-post-options.php:78
86
+ msgid "Select the taxonomies you don't want to be copied"
87
+ msgstr ""
88
+
89
+ #: duplicate-post-options.php:83
90
  msgid "Title prefix"
91
  msgstr ""
92
 
93
+ #: duplicate-post-options.php:87
94
  msgid ""
95
  "Prefix to be added before the original title when cloning a post/page, e.g. "
96
  "\"Copy of\" (blank for no prefix)"
97
  msgstr ""
98
 
99
+ #: duplicate-post-options.php:92
100
+ msgid "Title suffix"
101
  msgstr ""
102
 
103
+ #: duplicate-post-options.php:96
104
  msgid ""
105
+ "Suffix to be added after the original title when cloning a post/page, e.g. "
106
+ "\"(dup)\" (blank for no suffix)"
107
  msgstr ""
108
 
109
+ #: duplicate-post-options.php:101
110
+ msgid "Minimum level to copy posts"
111
  msgstr ""
112
 
113
+ #: duplicate-post-options.php:120
114
+ msgid ""
115
+ "Warning: users will be able to copy all posts, even those of higher level "
116
+ "users"
117
  msgstr ""
118
 
119
+ #: duplicate-post-options.php:129
120
+ msgid "Save Changes"
121
  msgstr ""
122
 
123
+ #: duplicate-post-common.php:63
124
+ msgid "Clone"
125
  msgstr ""
126
 
127
  #. Description of the plugin/theme
128
  msgid "Creates a copy of a post."
129
  msgstr ""
130
 
 
 
 
131
 
 
 
 
readme.txt CHANGED
@@ -1,71 +1,87 @@
1
  === Duplicate Post ===
2
  Contributors: lopo
3
- Donate link: http://www.lopo.it/duplicate-post-plugin/
4
- Tags: duplicate, post, copy
5
- Requires at least: 2.7
6
- Tested up to: 3.1.1
7
- Stable tag: 1.1.2
8
 
9
- Creates a copy of a post.
10
 
11
  == Description ==
12
 
13
- Allows to create a draft copy of a post (or page) in two ways:
14
- 1. In 'Edit Posts'/'Edit Pages', you can click on 'Duplicate' link;
15
- 2. While editing a post/page, you can click on 'Copy to a new draft' above "Cancel"/"Move to trash".
16
 
17
- Both ways lead to the edit page for the new draft: change what you want, click on 'Publish' and you're done.
 
 
 
 
 
 
 
 
18
 
19
- In the Options page it is now possible to choose:
20
  * if the original post/page date must be copied too
21
- * which custom fields must not be copied
22
- * a prefix to place before the title of the cloned post/page
23
- * the minimum user level to clone posts or pages
 
24
 
25
- Duplicate post is natively in English, but it's shipped with translations in 11 other languages (though some are incomplete). Now there is a [Launchpad translation project](https://translations.launchpad.net/duplicate-post/) available to help translating this plugin: feel free to contribute (you can also send me an e-mail using the form on my website).
26
 
27
- If you're a plugin developer, I suggest to read the section made just for you under "Other Notes", to ensure compatibility between your plugin(s) and mine!
28
 
29
- The plugin has been tested against versions 2.7 -> 3.1.1. It should be compatible with the Custom Post Type and Custom Taxonomies features of WP 3.0+. It's not yet been tested with the multiblog feature active (but it used to work with WPMU).
30
 
31
- Thanks for all the suggestions, bug reports, translations and donations: Franz, Ben ter Stal, [Naoko McCracken](http://blog.detlog.org), [Simon Wheatley](http://www.simonwheatley.co.uk/), [Magnus Anemo](http://www.anemo.se/en), Michelle Drumm, [TVbytheNumbers.com](http://www.TVbytheNumbers.com), Richard Vencu, [el_libre](http://www.catmidia.cat/), Antoine Jouve, Sebastian, Yaron, Hiroshi Tagawa, Adam Skiba, Bartosz Kaszubowski, Szymon Sieciński, Braiam Peguero, Jonay, tam, my friends Livia, Alessandra, Ada and anybody else that I may have forgotten (sorry!)
32
 
33
  Credit must be given to the (great) [Post Template](http://post-templates.vincentprat.info) plugin by Vincent Prat: I made this by hacking his work to get something more focused to a sporadic use, without the need to create and manage templates just to make simple copies of some posts every now and then. If my plugin doesn't fits your needs (and even if it does) check Vincent's.
34
 
35
- An example of use: I started this for a small movie theater website which I'm building. Every Friday there's a new movie showing with a new timetable, and thus a new post: but sometimes a movie stays for more than a week, so I need to copy the last post and change only the dates, leaving movie title, director's and actors' names etc. unchanged.
36
  The website is http://www.kino-desse.org and the cinema is located in Livorno, Italy.
37
 
38
  == Installation ==
39
 
 
 
40
  1. Upload `duplicate-post` directory to the `/wp-content/plugins/` directory
41
  2. Activate the plugin through the 'Plugins' menu in WordPress
42
  3. Go to Options -> Duplicate Post and customize behaviour as needed
43
 
44
- == For plugin developers ==
45
 
46
- From version 1.0 onwards, thanks to [Simon Wheatley](http://www.simonwheatley.co.uk/)'s suggestion, Duplicate Post adds two actions (*dp_duplicate_post* and *dp_duplicate_page*) which can be used by other developers if their plugins store extra data for posts in non-standard WP tables.
47
- Since Duplicate Post knows only of standard WP tables, it can't copy other data relevant to the post which is being copied if this information is stored elsewhere. So, if you're a plugin developer which acts this way, and you want to ensure compatibility with Duplicate Post, you can hook your functions to those actions to make sure that they will be called when a post (or page) is cloned.
48
 
49
- It's very simple. Just write your function that copies post metadata to a new row of your table:
50
- `function myplugin_copy_post($new_post_id, $old_post_object){
51
- /* your code */
52
- }`
53
 
54
- Then hook the function to the action:
55
- `add_action( "dp_duplicate_post", "myplugin_copy_post", $priority, 2);`
56
 
57
- Please refer to the [Plugin API](http://codex.wordpress.org/Plugin_API) for every information about the subject.
58
 
59
- == Contribute ==
60
 
61
- If you find this useful and you if you want to contribute, there are three ways:
62
 
63
- 1. You can [write me](http://www.lopo.it/contatti/) and submit your bug reports, suggestions and requests for features;
64
- 2. If you want to translate it to your language (there are just a few lines of text), you can use the [Launchpad translation project](https://translations.launchpad.net/duplicate-post/), or [contact me](http://www.lopo.it/contatti/) and I’ll send you the .pot catalogue; your translation could be featured in next releases;
65
- 3. Using the plugin is free, but if you want you can send me some bucks with PayPal [here](http://www.lopo.it/duplicate-post-plugin/)
 
 
 
 
 
 
 
 
 
66
 
67
  == Upgrade Notice ==
68
 
 
 
 
69
  = 1.1.1 =
70
  Some users have experienced a fatal error when upgrading to v1.1: this may fix it, if it's caused by a plugin conflict.
71
 
@@ -74,6 +90,15 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
74
 
75
  == Changelog ==
76
 
 
 
 
 
 
 
 
 
 
77
  = 1.1.2 =
78
  * WP 3.1.1 compatibility (still not tested against multiblog feature, so beware)
79
  * Added complete Polish language files
@@ -109,3 +134,51 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
109
  = 0.4 =
110
  * Support for new WP post revision feature
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === Duplicate Post ===
2
  Contributors: lopo
3
+ Donate link: http://lopo.it/duplicate-post-plugin/
4
+ Tags: duplicate post, copy, clone
5
+ Requires at least: 3.0
6
+ Tested up to: 3.3
7
+ Stable tag: 2.0
8
 
9
+ Clone posts and pages.
10
 
11
  == Description ==
12
 
13
+ This plugin allows to create a copy of a post (or page) in two ways.
 
 
14
 
15
+ 1. In 'Edit Posts'/'Edit Pages', you can click on 'Duplicate' link below the post/page title: this will immediately create a copy (with the same publish status of the original: 'publish', 'draft' or 'pending') and return to the list.
16
+
17
+ 2. While editing a post/page, you can click on 'Copy to a new draft' above "Cancel"/"Move to trash". This will lead to the edit page for the new draft: change what you want, click on 'Publish' and you're done.
18
+
19
+ **Pay attention to the new behaviour!** The first way now allows you to clone a post with a single click, speeding up your work if you have many posts to duplicate.
20
+
21
+ There is also a **template tag**, so you can put it in your templates and clone your posts/pages from the front-end. Clicking on the link will lead you to the edit page for the new draft, just like the second way above.
22
+
23
+ In the Options page under Settings it is now possible to choose:
24
 
 
25
  * if the original post/page date must be copied too
26
+ * if the original post/page excerpt must be copied too
27
+ * which taxonomies and custom fields must not be copied
28
+ * a prefix (or a suffix) to place before (or after) the title of the cloned post/page
29
+ * the minimum user level to clone posts or pages.
30
 
31
+ Duplicate post is natively in English, but it's shipped with translations in several other languages (though some are incomplete). Now there is a [Launchpad translation project](https://translations.launchpad.net/duplicate-post/) available to help translating this plugin: feel free to contribute (you can also send me an e-mail using the form on my website).
32
 
33
+ **If you're a plugin developer**, I suggest to read the section made just for you under "Other Notes", to ensure compatibility between your plugin(s) and mine!
34
 
35
+ The plugin has been tested against versions 3.0 -> 3.3. It's not yet been tested with the multiblog feature active (but it used to work with WPMU).
36
 
37
+ Thanks for all the suggestions, bug reports, translations and donations, they're frankly too many to be listed here!
38
 
39
  Credit must be given to the (great) [Post Template](http://post-templates.vincentprat.info) plugin by Vincent Prat: I made this by hacking his work to get something more focused to a sporadic use, without the need to create and manage templates just to make simple copies of some posts every now and then. If my plugin doesn't fits your needs (and even if it does) check Vincent's.
40
 
41
+ An example of use: I started this for a small movie theater website which I was building. Every Friday there's a new movie showing with a new timetable, and thus a new post: but sometimes a movie stays for more than a week, so I need to copy the last post and change only the dates, leaving movie title, director's and actors' names etc. unchanged.
42
  The website is http://www.kino-desse.org and the cinema is located in Livorno, Italy.
43
 
44
  == Installation ==
45
 
46
+ Use WordPress' Add New Plugin feature, searching "Duplicate Post", or download the archive and:
47
+
48
  1. Upload `duplicate-post` directory to the `/wp-content/plugins/` directory
49
  2. Activate the plugin through the 'Plugins' menu in WordPress
50
  3. Go to Options -> Duplicate Post and customize behaviour as needed
51
 
52
+ == Frequently Asked Questions ==
53
 
54
+ = When I click "Duplicate" in the Posts list, I'm not redirected to the edit screen anymore! Is it a bug? =
 
55
 
56
+ No, it's a new feature. A lot of users found the usual behaviour of the plugin too complicated when they had a large number of posts to clone, and they were right.
57
+ Check the description to learn how the plugin behaves now.
 
 
58
 
59
+ = The plugin doesn't work, why? =
 
60
 
61
+ First, check your version of WordPress: the plugin is not supposed to work anymore on old versions.
62
 
63
+ Then try to deactivate and re-activate it, some user have reported that this fixes the problem.
64
 
65
+ If not, maybe there is some kind of conflict with other plugins: feel free to write me and we'll try to discover a solution (it will be *really* helpful if you try to deactivate all your other plugins one by one to see which one conflicts with mine... But do it only if you know what you're doing, I will not be responsible of any problem you may experience).
66
 
67
+ = Can you add it to the bulk actions in the post/page list? =
68
+
69
+ I can't. There is no way to do it without hacking the core code of WordPress.
70
+ There is an open ticket in WordPress Trac, as other plugin developers too are interested to this feature: we can only hope that eventually our wish will be fulfilled.
71
+
72
+
73
+ == Screenshots ==
74
+
75
+ 1. Here you can copy the post you're editing to a new draft
76
+ 2. By clicking on "Duplicate" the post is cloned immediately.
77
+ 3. The option page
78
+ 4. The template tag manually added to the Twenty Ten theme. Click on the "Clone" link and you're redirected to the edit screen for a new draft copy of your post.
79
 
80
  == Upgrade Notice ==
81
 
82
+ = 2.0 =
83
+ Several improvements and new features, see changelog. Requires WP 3.0+.
84
+
85
  = 1.1.1 =
86
  Some users have experienced a fatal error when upgrading to v1.1: this may fix it, if it's caused by a plugin conflict.
87
 
90
 
91
  == Changelog ==
92
 
93
+ = 2.0 =
94
+ * WP 3.3 compatibility (still not tested against multiblog feature, so beware)
95
+ * Minimum WP version: 3.0
96
+ * Code cleanup
97
+ * Immediate cloning from post list
98
+ * Added options for taxonomies and post excerpt
99
+ * Added suffix option
100
+ * Added template tag
101
+
102
  = 1.1.2 =
103
  * WP 3.1.1 compatibility (still not tested against multiblog feature, so beware)
104
  * Added complete Polish language files
134
  = 0.4 =
135
  * Support for new WP post revision feature
136
 
137
+
138
+
139
+ == Template tag ==
140
+
141
+ I have added the template tag `duplicate_post_clone_post_link( $link, $before, $after, $id )`, which behaves just like [edit_post_link()](http://codex.wordpress.org/Function_Reference/edit_post_link).
142
+ That means that you can put it in your template (e.g., in single.php or page.php) so you can get a "Clone" link when displaying a post or page.
143
+
144
+ The parameters are:
145
+
146
+ * *link*
147
+ (string) (optional) The link text. Default: __('Clone','duplicate-post')
148
+
149
+ * *before*
150
+ (string) (optional) Text to put before the link text. Default: None
151
+
152
+ * *after*
153
+ (string) (optional) Text to put after the link text. Default: None
154
+
155
+ * *id*
156
+ (integer) (optional) Post ID. Default: Current post ID
157
+
158
+
159
+
160
+ == For plugin developers ==
161
+
162
+ From version 1.0 onwards, thanks to [Simon Wheatley](http://www.simonwheatley.co.uk/)'s suggestion, Duplicate Post adds two actions (*dp_duplicate_post* and *dp_duplicate_page*) which can be used by other developers if their plugins store extra data for posts in non-standard WP tables.
163
+ Since Duplicate Post knows only of standard WP tables, it can't copy other data relevant to the post which is being copied if this information is stored elsewhere. So, if you're a plugin developer which acts this way, and you want to ensure compatibility with Duplicate Post, you can hook your functions to those actions to make sure that they will be called when a post (or page) is cloned.
164
+
165
+ It's very simple. Just write your function that copies post metadata to a new row of your table:
166
+ `function myplugin_copy_post($new_post_id, $old_post_object){
167
+ /* your code */
168
+ }`
169
+
170
+ Then hook the function to the action:
171
+ `add_action( "dp_duplicate_post", "myplugin_copy_post", $priority, 2);`
172
+
173
+ dp_duplicate_page is used for pages and hierarchical custom post types; for every other type of posts, dp_duplicate_post is used.
174
+
175
+ Please refer to the [Plugin API](http://codex.wordpress.org/Plugin_API) for every information about the subject.
176
+
177
+ == Contribute ==
178
+
179
+ If you find this useful and you if you want to contribute, there are three ways:
180
+
181
+ 1. You can [write me](http://www.lopo.it/contatti/) and submit your bug reports, suggestions and requests for features;
182
+ 2. If you want to translate it to your language (there are just a few lines of text), you can use the [Launchpad translation project](https://translations.launchpad.net/duplicate-post/), or [contact me](http://www.lopo.it/contatti/) and I’ll send you the .pot catalogue; your translation could be featured in next releases;
183
+ 3. Using the plugin is free, but if you want you can send me some bucks with PayPal [here](http://www.lopo.it/duplicate-post-plugin/)
184
+
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
todo.txt DELETED
@@ -1 +0,0 @@
1
- - Unify post/page split