{"id":1425863,"date":"2018-01-14T03:07:12","date_gmt":"2018-01-14T11:07:12","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/"},"modified":"2018-01-14T03:07:12","modified_gmt":"2018-01-14T11:07:12","slug":"abstract-post-types-70-there-but-last-hurdle-to-cross","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/","title":{"rendered":"Abstract Post Types &#8211; 70% there &#8211; but last hurdle to cross"},"content":{"rendered":"<p>I&#8217;ve made some great progress with <strong>Abstract Post Types<\/strong> &#8211; but have now hit a wall<\/p>\n<p>I have added the post types &#8211; got them linked and showing in the edit event screen nicely<\/p>\n<p>If I select from some previously created linked <strong>Abstract Post Types<\/strong>, they save!<\/p>\n<p>All so good so far<\/p>\n<p>Now &#8211; the issues<\/p>\n<p>Does anyone have a code snippet for quickly outputting the linked Abstract Post Type to a UL? I guess I need to use tribe_get_linked_post_types or tribe_has_linked_posts_by_post_type<\/p>\n<p>And the other issue, I have enabled creation of the post types from the event screen &#8211; so it should work in the same way as venues do &#8211; but it doesn&#8217;t &#8211; it doesn&#8217;t save at all when I save the main event &#8211; is there something obvious that I have missed?<\/p>\n<p>My code snippet is as per below<\/p>\n<p>`\/\/ Register Custom Post Type<br \/>\nfunction register_included_element() {<\/p>\n<pre><code>$labels = array(\n    'name'                  =&amp;gt; 'Included Element',\n    'singular_name'         =&amp;gt; 'included-element',\n    'singular_name_lowercase'=&amp;gt; 'included-element',\n    'menu_name'             =&amp;gt; 'Included Elements',\n    'name_admin_bar'        =&amp;gt; 'Included Element',\n    'archives'              =&amp;gt; 'Included Element Archives',\n    'attributes'            =&amp;gt; 'Included Element Attributes',\n    'parent_item_colon'     =&amp;gt; 'Parent Included Element:',\n    'all_items'             =&amp;gt; 'Included Elements',\n    'add_new_item'          =&amp;gt; 'Add New Included Element',\n    'add_new'               =&amp;gt; 'Add New',\n    'new_item'              =&amp;gt; 'New Included Element',\n    'edit_item'             =&amp;gt; 'Edit Included Element',\n    'update_item'           =&amp;gt; 'Update Included Element',\n    'view_item'             =&amp;gt; 'View Included Element',\n    'view_items'            =&amp;gt; 'View Included Elements',\n    'search_items'          =&amp;gt; 'Search Included Element',\n    'not_found'             =&amp;gt; 'Not found',\n    'not_found_in_trash'    =&amp;gt; 'Not found in Trash',\n    'featured_image'        =&amp;gt; 'Featured Image',\n    'set_featured_image'    =&amp;gt; 'Set featured image',\n    'remove_featured_image' =&amp;gt; 'Remove featured image',\n    'use_featured_image'    =&amp;gt; 'Use as featured image',\n    'insert_into_item'      =&amp;gt; 'Insert into Included Element',\n    'uploaded_to_this_item' =&amp;gt; 'Uploaded to this Included Element',\n    'items_list'            =&amp;gt; 'Included Elements list',\n    'items_list_navigation' =&amp;gt; 'Included Elements list navigation',\n    'filter_items_list'     =&amp;gt; 'Filter Included Elements list',\n);\n$args = array(\n    'label'                 =&amp;gt; 'Included Element',\n    'labels'                =&amp;gt; $labels,\n    'supports'              =&amp;gt; array('title', 'editor'),\n    'hierarchical'          =&amp;gt; false,\n    'public'                =&amp;gt; true,\n    'show_ui'               =&amp;gt; true,\n    'show_in_menu'          =&amp;gt; \"\/edit.php?post_type=tribe_events\",\n    'menu_position'         =&amp;gt; 5,\n    'menu_icon'             =&amp;gt; 'dashicons-menu',\n    'show_in_admin_bar'     =&amp;gt; false,\n    'show_in_nav_menus'     =&amp;gt; false,\n    'can_export'            =&amp;gt; true,\n    'has_archive'           =&amp;gt; false,\n    'exclude_from_search'   =&amp;gt; true,\n    'publicly_queryable'    =&amp;gt; true,\n    'capability_type'       =&amp;gt; 'page',\n);\n\nregister_post_type( 'included-element', $args );\n<\/code><\/pre>\n<p>}<\/p>\n<p>\/\/ Register Custom Post Type<br \/>\nfunction register_excluded_element() {<\/p>\n<pre><code>$labels = array(\n    'name'                  =&amp;gt; 'Excluded Element',\n    'singular_name'         =&amp;gt; 'excluded-element',\n    'singular_name_lowercase'=&amp;gt; 'excluded-element',\n    'menu_name'             =&amp;gt; 'Excluded Elements',\n    'name_admin_bar'        =&amp;gt; 'Excluded Element',\n    'archives'              =&amp;gt; 'Excluded Element Archives',\n    'attributes'            =&amp;gt; 'Excluded Element Attributes',\n    'parent_item_colon'     =&amp;gt; 'Parent Excluded Element:',\n    'all_items'             =&amp;gt; 'Excluded Elements',\n    'add_new_item'          =&amp;gt; 'Add New Excluded Element',\n    'add_new'               =&amp;gt; 'Add New',\n    'new_item'              =&amp;gt; 'New Excluded Element',\n    'edit_item'             =&amp;gt; 'Edit Excluded Element',\n    'update_item'           =&amp;gt; 'Update Excluded Element',\n    'view_item'             =&amp;gt; 'View Excluded Element',\n    'view_items'            =&amp;gt; 'View Excluded Elements',\n    'search_items'          =&amp;gt; 'Search Excluded Element',\n    'not_found'             =&amp;gt; 'Not found',\n    'not_found_in_trash'    =&amp;gt; 'Not found in Trash',\n    'featured_image'        =&amp;gt; 'Featured Image',\n    'set_featured_image'    =&amp;gt; 'Set featured image',\n    'remove_featured_image' =&amp;gt; 'Remove featured image',\n    'use_featured_image'    =&amp;gt; 'Use as featured image',\n    'insert_into_item'      =&amp;gt; 'Insert into Excluded Element',\n    'uploaded_to_this_item' =&amp;gt; 'Uploaded to this Excluded Element',\n    'items_list'            =&amp;gt; 'Excluded Elements list',\n    'items_list_navigation' =&amp;gt; 'Excluded Elements list navigation',\n    'filter_items_list'     =&amp;gt; 'Filter Excluded Elements list',\n);\n$args = array(\n    'label'                 =&amp;gt; 'Excluded Element',\n    'labels'                =&amp;gt; $labels,\n    'supports'              =&amp;gt; array('title', 'editor'),\n    'hierarchical'          =&amp;gt; false,\n    'public'                =&amp;gt; true,\n    'show_ui'               =&amp;gt; true,\n    'show_in_menu'          =&amp;gt; \"\/edit.php?post_type=tribe_events\",\n    'menu_position'         =&amp;gt; 5,\n    'menu_icon'             =&amp;gt; 'dashicons-menu',\n    'show_in_admin_bar'     =&amp;gt; false,\n    'show_in_nav_menus'     =&amp;gt; false,\n    'can_export'            =&amp;gt; true,\n    'has_archive'           =&amp;gt; false,\n    'exclude_from_search'   =&amp;gt; true,\n    'publicly_queryable'    =&amp;gt; true,\n    'capability_type'       =&amp;gt; 'page',\n);\n\nregister_post_type( 'excluded-element', $args );\n<\/code><\/pre>\n<p>}<\/p>\n<p>function register_testimonial_snippet() {<\/p>\n<pre><code>$labels = array(\n    'name'                  =&amp;gt; 'Testimonial Snippet',\n    'singular_name'         =&amp;gt; 'testimonial-snippet',\n    'singular_name_lowercase'=&amp;gt; 'testimonial-snippet',\n    'menu_name'             =&amp;gt; 'Testimonial Snippets',\n    'name_admin_bar'        =&amp;gt; 'Testimonial Snippet',\n    'archives'              =&amp;gt; 'Testimonial Snippet Archives',\n    'attributes'            =&amp;gt; 'Testimonial Snippet Attributes',\n    'parent_item_colon'     =&amp;gt; 'Parent Testimonial Snippet:',\n    'all_items'             =&amp;gt; 'Testimonial Snippets',\n    'add_new_item'          =&amp;gt; 'Add New Testimonial Snippet',\n    'add_new'               =&amp;gt; 'Add New',\n    'new_item'              =&amp;gt; 'New Testimonial Snippet',\n    'edit_item'             =&amp;gt; 'Edit Testimonial Snippet',\n    'update_item'           =&amp;gt; 'Update Testimonial Snippet',\n    'view_item'             =&amp;gt; 'View Testimonial Snippet',\n    'view_items'            =&amp;gt; 'View Testimonial Snippets',\n    'search_items'          =&amp;gt; 'Search Testimonial Snippet',\n    'not_found'             =&amp;gt; 'Not found',\n    'not_found_in_trash'    =&amp;gt; 'Not found in Trash',\n    'featured_image'        =&amp;gt; 'Featured Image',\n    'set_featured_image'    =&amp;gt; 'Set featured image',\n    'remove_featured_image' =&amp;gt; 'Remove featured image',\n    'use_featured_image'    =&amp;gt; 'Use as featured image',\n    'insert_into_item'      =&amp;gt; 'Insert into Testimonial Snippet',\n    'uploaded_to_this_item' =&amp;gt; 'Uploaded to this Testimonial Snippet',\n    'items_list'            =&amp;gt; 'Testimonial Snippets list',\n    'items_list_navigation' =&amp;gt; 'Testimonial Snippets list navigation',\n    'filter_items_list'     =&amp;gt; 'Filter Testimonial Snippets list',\n);\n$args = array(\n    'label'                 =&amp;gt; 'Testimonial Snippet',\n    'labels'                =&amp;gt; $labels,\n    'supports'              =&amp;gt; array('title', 'editor'),\n    'hierarchical'          =&amp;gt; false,\n    'public'                =&amp;gt; true,\n    'show_ui'               =&amp;gt; true,\n    'show_in_menu'          =&amp;gt; \"\/edit.php?post_type=tribe_events\",\n    'menu_position'         =&amp;gt; 5,\n    'menu_icon'             =&amp;gt; 'dashicons-menu',\n    'show_in_admin_bar'     =&amp;gt; false,\n    'show_in_nav_menus'     =&amp;gt; false,\n    'can_export'            =&amp;gt; true,\n    'has_archive'           =&amp;gt; false,\n    'exclude_from_search'   =&amp;gt; true,\n    'publicly_queryable'    =&amp;gt; true,\n    'capability_type'       =&amp;gt; 'page',\n);\n\nregister_post_type( 'testimonial-snippet', $args );\n<\/code><\/pre>\n<p>}<\/p>\n<p>function link_excluded_elements_to_events() {<br \/>\n    tribe_register_linked_post_type( &#8216;excluded-element&#8217;, array(<br \/>\n            singular_name =&gt; &#8216;Excluded Element&#8217;,<br \/>\n            singular_name_lowercase =&gt; &#8216;excluded element&#8217;,<br \/>\n            allow_multiple =&gt; true,<br \/>\n            allow_creation =&gt; true<br \/>\n        )<br \/>\n);<br \/>\n}<\/p>\n<p>function link_included_elements_to_events() {<br \/>\n    tribe_register_linked_post_type( &#8216;included-element&#8217;, array(<br \/>\n            singular_name =&gt; &#8216;Included Element&#8217;,<br \/>\n            singular_name_lowercase =&gt; &#8216;included element&#8217;,<br \/>\n            allow_multiple =&gt; true,<br \/>\n            allow_creation =&gt; true<br \/>\n        ));<br \/>\n}<\/p>\n<p>function link_testimonial_snippets_to_events() {<br \/>\n    tribe_register_linked_post_type( &#8216;testimonial-snippet&#8217;, array(<br \/>\n            singular_name =&gt; &#8216;Testimonial Snippet&#8217;,<br \/>\n            singular_name_lowercase =&gt; &#8216;testimonial snippet&#8217;,<br \/>\n            allow_multiple =&gt; true,<br \/>\n            allow_creation =&gt; true<br \/>\n        ));<br \/>\n}<\/p>\n<p>add_action( &#8216;init&#8217;, &#8216;register_included_element&#8217;, 0 );<br \/>\nadd_action( &#8216;init&#8217;, &#8216;register_excluded_element&#8217;, 0 );<br \/>\nadd_action( &#8216;init&#8217;, &#8216;register_testimonial_snippet&#8217;, 0 );<\/p>\n<p>add_action( &#8216;init&#8217;, &#8216;link_included_elements_to_events&#8217; );<br \/>\nadd_action( &#8216;init&#8217;, &#8216;link_excluded_elements_to_events&#8217; );<br \/>\nadd_action( &#8216;init&#8217;, &#8216;link_testimonial_snippets_to_events&#8217; );`<\/p>\n","protected":false},"template":"","class_list":["post-1425863","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Abstract Post Types - 70% there - but last hurdle to cross -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Abstract Post Types - 70% there - but last hurdle to cross -\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve made some great progress with Abstract Post Types &#8211; but have now hit a wall I have added the post types &#8211; got them linked and showing in the edit event screen nicely If I select from some previously created linked Abstract Post Types, they save! All so good so far Now &#8211; the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/\",\"name\":\"Abstract Post Types - 70% there - but last hurdle to cross -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-01-14T11:07:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Abstract Post Types &#8211; 70% there &#8211; but last hurdle to cross\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Abstract Post Types - 70% there - but last hurdle to cross -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/","og_locale":"en_US","og_type":"article","og_title":"Abstract Post Types - 70% there - but last hurdle to cross -","og_description":"I&#8217;ve made some great progress with Abstract Post Types &#8211; but have now hit a wall I have added the post types &#8211; got them linked and showing in the edit event screen nicely If I select from some previously created linked Abstract Post Types, they save! All so good so far Now &#8211; the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/","name":"Abstract Post Types - 70% there - but last hurdle to cross -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-01-14T11:07:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/abstract-post-types-70-there-but-last-hurdle-to-cross\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Abstract Post Types &#8211; 70% there &#8211; but last hurdle to cross"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1425863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1425863\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1425863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}