{"id":50646,"date":"2016-09-01T18:58:59","date_gmt":"2016-09-01T18:58:59","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/deserialize-metadata\/"},"modified":"2018-08-01T17:09:52","modified_gmt":"2018-08-01T17:09:52","slug":"deserialize-metadata","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/deserialize-metadata\/","author":15015863,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.0.8","stable_tag":"0.0.8","tested":"4.7.33","requires":"4.5.3","requires_php":"","requires_plugins":"","header_name":"Deserialize Metadata","header_author":"Jonathan Stegall","header_description":"","assets_banners_color":"","last_updated":"2018-08-01 17:09:52","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/deserialize-metadata\/","header_author_uri":"https:\/\/code.minnpost.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1095,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.0.8"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[87,2994],"plugin_category":[59],"plugin_contributors":[96523,130480],"plugin_business_model":[],"class_list":["post-50646","plugin","type-plugin","status-closed","hentry","plugin_tags-import","plugin_tags-metadata","plugin_category-utilities-and-tools","plugin_contributors-jonathanstegall","plugin_contributors-minnpost","plugin_committers-minnpost"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/deserialize-metadata.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>When migrating from another system (i.e. Drupal), WordPress can require data that is currently serialized to be unserialized and stored in its own WordPress-specific tables\/columns. This plugin can look for such data, and deserialize and store it, based on the plugin settings.<\/p>\n\n<p>This plugin handles one (configurable) imported field at a time, so all imported, serialized data needs to be stored in that single field. Each key in that field can be mapped to any column, and stored in either <code>wp_postmeta<\/code> or <code>wp_posts<\/code>, as shown below:<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>if ( $maps[$key]['wp_table'] === 'wp_postmeta' &amp;&amp; $value != '' &amp;&amp; $value != NULL ) {\n    add_post_meta( $post_id, $maps[$key]['wp_column'], $value, $maps[$key]['unique'] );\n} else if ( $maps[$key]['wp_table'] === 'wp_posts' &amp;&amp; $value != '' &amp;&amp; $value != NULL ) {\n    $post = array(\n        'ID' =&gt; $post_id,\n        $maps[$key]['wp_column'] =&gt; $value\n    );\n    wp_update_post( $post );\n}\n    `<\/p>\n\n<p>The <code>wp_schedule_event<\/code> method is used to deserialize the data and place it into its appropriate fields, and it can run at any configurable interval (you pick a number, and then a unit of time).<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>deserialize-metadata<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Fill out the settings on the Deserialize Metadata subpage of the Settings menu<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>Upload the <code>deserialize-metadata<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Fill out the settings on the Deserialize Metadata subpage of the Settings menu<\/li>\n<\/ol><\/dd>\n\n<\/dl>","raw_excerpt":"When migrating from another system (i.e. Drupal), WordPress can require data that is currently serialized to be unserialized and stored in its own Wor &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/50646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=50646"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/minnpost"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=50646"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=50646"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=50646"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=50646"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=50646"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=50646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}