urosevic icon

WP Duplicate Post fix for AI1EC

urosevic | PRO | 02/03/15 02:26:34 PM UTC | 0 ⭐ | 1156 👁️ | Never ⏰ | []
Diff |

1.81 KB

|

None

|

0 👍

/

0 👎

--- X:/Downloads/duplicate-post/duplicate-post-admin.php    Tue Feb 03 16:19:41 2015
+++ X:/Downloads/fix/duplicate-post/duplicate-post-admin.php    Tue Feb 03 16:20:18 2015
@@ -143,8 +143,8 @@
 /**
  * Connect actions to functions
  */
-add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
-add_action('admin_action_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
+add_action('admin_action_dp_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
+add_action('admin_action_dp_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
 
 /*
  * This function calls the creation of a new copy of the selected post (as a draft)
@@ -159,7 +159,7 @@
  * then redirects to the post list
  */
 function duplicate_post_save_as_new_post($status = ''){
-   if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
+   if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'dp_duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {
        wp_die(__('No post to duplicate has been supplied!', DUPLICATE_POST_I18N_DOMAIN));
    }
 
--- X:/Downloads/duplicate-post/duplicate-post-common.php   Tue Feb 03 16:19:22 2015
+++ X:/Downloads/duplicate-post/fix/duplicate-post/duplicate-post-common.php    Tue Feb 03 16:03:37 2015
@@ -32,9 +32,9 @@
    return;
 
    if ($draft)
-   $action_name = "duplicate_post_save_as_new_post_draft";
+   $action_name = "dp_duplicate_post_save_as_new_post_draft";
    else
-   $action_name = "duplicate_post_save_as_new_post";
+   $action_name = "dp_duplicate_post_save_as_new_post";
 
    if ( 'display' == $context )
    $action = '?action='.$action_name.'&post='.$post->ID;

Comments