function motopressCEClonePostmeta($post_id_from, $post_id_to) { motopressCEClearPostmeta($post_id_to); update_post_meta($post_id_to, 'motopress-ce-edited-post', $post_id_from); $all_post_meta = get_post_custom_keys($post_id_from); if (is_array($all_post_meta)) { foreach ($all_post_meta as $post_meta_key) { // fix of the issue with "Custom Permalinks" plugin http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/ if ($post_meta_key == "custom_permalink") { continue; } $values = get_post_custom_values($post_meta_key, $post_id_from); foreach ($values as $value) { add_post_meta($post_id_to, $post_meta_key, maybe_unserialize($value)); } } } }
function motopressCEClonePostmeta($post_id_from, $post_id_to) { motopressCEClearPostmeta($post_id_to); add_post_meta($post_id_to, 'motopress-ce-edited-post', $post_id_from); $all_post_meta = get_post_custom_keys($post_id_from); if (is_array($all_post_meta)) { foreach ($all_post_meta as $post_meta_key) { $values = get_post_custom_values($post_meta_key, $post_id_from); foreach ($values as $value) { add_post_meta($post_id_to, $post_meta_key, maybe_unserialize($value)); } } } }