{"id":1284571,"date":"2019-07-12T13:34:27","date_gmt":"2019-07-12T13:34:27","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1284571"},"modified":"2021-03-09T12:41:06","modified_gmt":"2021-03-09T12:41:06","slug":"convert-existing-custom-types-and-fields-to-types-control","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/de\/course-lesson\/convert-existing-custom-types-and-fields-to-types-control\/","title":{"rendered":"Convert existing custom types and fields to Types control"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Converting custom post types and taxonomy<\/h2>\n\n\n\n<p>To convert&nbsp;<a href=\"https:\/\/toolset.com\/de\/glossary\/custom-post-type\/\">custom post types<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/toolset.com\/de\/glossary\/taxonomy\/\">taxonomies<\/a>&nbsp;you have to:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Remove the PHP that declared these custom types. Normally, you would remove them from&nbsp;<code>functions.php<\/code>&nbsp;in the theme. Once you do this, all your custom data will appear to have vanished. Do not worry. It just is not shown.<\/li><li>Add it using Types. Make sure that you use the exact same slug. The description can be different but the slug is crucial. If it is different, the old content will not be shown.<\/li><\/ol>\n\n\n\n<p>Now you should see all of your content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Converting custom fields<\/h2>\n\n\n\n<p>To convert&nbsp;<a href=\"https:\/\/toolset.com\/de\/glossary\/custom-fields\/\">custom fields<\/a>&nbsp;you have to:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create custom field groups. You should leave them blank (without adding any fields). This is because we will go and add the existing fields to them.<\/li><li>Go to&nbsp;<strong>Toolset&nbsp;<\/strong>\u2192&nbsp;<strong>Custom Fields<\/strong>&nbsp;and click the&nbsp;<strong>Post&nbsp;Field Control<\/strong>&nbsp;button. On the Post Field Control page, find the fields you&nbsp;are interested in. On each field\u2019s row click on&nbsp;<strong>Change assignment<\/strong>&nbsp;and, in the pop-up dialog box that appears, select the corresponding group you created in the first step. Then, for each one of&nbsp;the desired fields,&nbsp;click on the&nbsp;<strong>Change type<\/strong>&nbsp;link and select the option you find appropriate.<\/li><\/ol>\n\n\n\n<p>Your custom fields will now be under Types control.<\/p>\n","protected":false},"author":4341,"featured_media":1666941,"template":"","related-lesson":[8403],"class_list":["post-1284571","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-custom-types"],"_links":{"self":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1284571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1284571\/revisions"}],"predecessor-version":[{"id":1979709,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1284571\/revisions\/1979709"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media\/1666941"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media?parent=1284571"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/related-lesson?post=1284571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}