Advertisement
urosevic

WP Duplicate Post fix for AI1EC

Feb 3rd, 2015
748
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- X:/Downloads/duplicate-post/duplicate-post-admin.php    Tue Feb 03 16:19:41 2015
  2. +++ X:/Downloads/fix/duplicate-post/duplicate-post-admin.php    Tue Feb 03 16:20:18 2015
  3. @@ -143,8 +143,8 @@
  4.  /**
  5.   * Connect actions to functions
  6.   */
  7. -add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
  8. -add_action('admin_action_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
  9. +add_action('admin_action_dp_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
  10. +add_action('admin_action_dp_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
  11.  
  12.  /*
  13.   * This function calls the creation of a new copy of the selected post (as a draft)
  14. @@ -159,7 +159,7 @@
  15.   * then redirects to the post list
  16.   */
  17.  function duplicate_post_save_as_new_post($status = ''){
  18. -   if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
  19. +   if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'dp_duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
  20.         wp_die(__('No post to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN));
  21.     }
  22.  
  23. --- X:/Downloads/duplicate-post/duplicate-post-common.php   Tue Feb 03 16:19:22 2015
  24. +++ X:/Downloads/duplicate-post/fix/duplicate-post/duplicate-post-common.php    Tue Feb 03 16:03:37 2015
  25. @@ -32,9 +32,9 @@
  26.     return;
  27.  
  28.     if ($draft)
  29. -   $action_name = "duplicate_post_save_as_new_post_draft";
  30. +   $action_name = "dp_duplicate_post_save_as_new_post_draft";
  31.     else
  32. -   $action_name = "duplicate_post_save_as_new_post";
  33. +   $action_name = "dp_duplicate_post_save_as_new_post";
  34.  
  35.     if ( 'display' == $context )
  36.     $action = '?action='.$action_name.'&post='.$post->ID;
Advertisement
RAW Paste Data Copied
Advertisement