Problem is solved. 🙂
i have changed following code in duplicate-post-admin.php at line 278:
if ($post->post_type == 'page' || (function_exists('is_post_type_hierarchical') && is_post_type_hierarchical( $post->post_type )))
do_action( 'dp_duplicate_page', $new_post_id, $post );
else
do_action( 'dp_duplicate_post', $new_post_id, $post );
to
if ($post->post_type == 'page' || (function_exists('is_post_type_hierarchical') && is_post_type_hierarchical( $post->post_type )))
do_action( 'dp_duplicate_page', $new_id, $post );
else
do_action( 'dp_duplicate_post', $new_id, $post );
Hi,
thank you for reporting the issue.
Your workaround isn’t exactly right, there is no $new_id in that function, so probably it simply prevents actions to be called.
This means that custom fields will never be copied.
You should try to change lines 224-225 from
$post_meta_keys = get_post_custom_keys($post->ID);
$meta_blacklist = explode(",",get_option('duplicate_post_blacklist'));
to
$post_meta_keys = get_post_custom_keys($post->ID);
if (empty($post_meta_keys)) return;
$meta_blacklist = explode(",",get_option('duplicate_post_blacklist'));
I hope this works.
I’ll make sure to fix the issue in the next version.
Thank you!
I did as you said. Now it is working fine but it does not copy categories, tag and custom fields. After cloning the post, it takes the default categories(Uncategorized), tags(No Tags). Please advice.
Thank you in advance.
Hi logo,
Sorry, i made some stupid wrong when i edited. Your plugins is great and working great. Thanks for your great work and reply.
Hi,
version 2.3 (out now) includes the fix for this bug.