hi there,
I was looking at your code to see how you clone/duplicate posts because I wanted to do something similar in my plugin.
I noticed an issue when posts are cloned with serialized post meta, or when the post meta was stored as an array (which is serialized by WP).
By adding a small check when you loop through the meta, it will also handle serialized arrays correctly:
foreach ( $meta as $key => $val ) {
$meta_value = $val[0];
if ( is_serialized( $meta_value ) ) {
$meta_value = @maybe_unserialize( $meta_value );
}
update_post_meta( $new_id, $key, $meta_value );
}
]]>
I get an error when I click on the pages page in wordpress: Warning: in_array() expects parameter 2 to be array, bool given in /srv/www/vhosts/fullframestudios.ch/httpdocs/wp-content/plugins/clone-posts/admin/class-clone-posts-admin.php on line 375
Anything that can be done about this?
This is WordPress 5.8.
]]>The current version of the plugin returns a fatal error when attempting to Activate on installation or upgrade.
The error log reports:
PHP Parse error: syntax error, unexpected ‘)’ in public_html/wp-content/plugins/clone-posts/admin/class-clone-posts-admin.php on line 160
The problem appears to be a trailing comma in line 159:
register_setting(
'clone_post_settings',
'clone_posts_post_type',
[$this,'clonePosts_sanitize_array'],
);
Removing the trailing comma resolves the issue.
]]>Hello @lukasz.webmaster,
It seems that your Clone Posts plugin has been abandoned, since it was last updated 7 years ago.
Instead of letting this plugin stagnate, I would be interested in adopting it and continue development where you left off.
Would you be willing to add me as a committer or transfer ownership as explained here?
I will then be responsible for all future development, maintenance, updates and to ensure the plugin complies with all plugin guidelines. Of course your name as contributor will be retained.
Thank you for considering this!
George P.
With the latest version of WP, when you “clone” a post, directly, it redirect to the “Posts” screen, and there’s no cloned post.
Best regards.
]]>Hi–
I have a site that is using plugins that store most of the page’s text in the wp_postmeta table, rather than the actual posts table. Because of this, there is no way to view/revert to previous versions of the page. I downloaded and installed your plugin hoping that it would allow me to at least store previous versions of the entire page, but it doesn’t seem as if it clones the data from the wp_postmeta table. Is there a way to add this functionality to your plugin?
]]>trim symbol \
when clone post
Hello dear
I am testing, and not working
]]>