We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 55d2215 + 1e6f87d commit 9ce5b33Copy full SHA for 9ce5b33
modules/tool/inc/process-import.php
@@ -118,6 +118,22 @@
118
}
119
120
foreach ( $meta as $meta_key => $meta_value ) {
121
+ if ( false !== stripos( $meta_key, '_roles' ) || false !== stripos( $meta_key, '_users' ) ) {
122
+ if ( is_serialized( $meta_value ) ) {
123
+ $unserialized_meta_value = unserialize( $meta_value );
124
+
125
+ /**
126
+ * The value of $meta_value after serialized should be an array.
127
+ * If it's still a string, then we need to unserialize it.
128
+ *
129
+ * This was related to widget roles issue on export / import.
130
+ */
131
+ if ( is_string( $unserialized_meta_value ) ) {
132
+ $meta_value = $unserialized_meta_value;
133
+ }
134
135
136
137
update_post_meta( $post_id, $meta_key, $meta_value );
138
139
0 commit comments