{"id":1097516,"date":"2016-04-03T00:09:33","date_gmt":"2016-04-03T07:09:33","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/"},"modified":"2016-04-19T09:35:07","modified_gmt":"2016-04-19T16:35:07","slug":"jetpack-how-to-use-publicize-with-your-custom-post-types","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/","title":{"rendered":"Jetpack, How to use Publicize with your Custom Post Types"},"content":{"rendered":"<p>Hello,<br \/>\nmy question:<br \/>\ncan I use this function offers by jetpack?<\/p>\n<p>How to use Publicize with your Custom Post Types<br \/>\nBy default, Publicize is only triggered when you publish a new post. You can, however, extend this to other Custom Post Types. You have 2 options to add Publicize Support to a Custom Post Type:<\/p>\n<p>You can add Publicize support to an existing post type thanks to the add_post_type_support() function. To do so, add the following code to a functionality plugin:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\nadd_action(&#8216;init&#8217;, &#8216;my_custom_init&#8217;);<br \/>\nfunction my_custom_init() {<br \/>\n    add_post_type_support( &#8216;product&#8217;, &#8216;publicize&#8217; );<br \/>\n}<br \/>\nYou\u2019ll need to replace \u201cproduct\u201d by your Custom Post Type name.<\/p>\n<p>You can add Publicize support when registering the post type, like so:<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n14<br \/>\n15<br \/>\n\/\/ Register Custom Post Type<br \/>\nfunction custom_post_type() {<\/p>\n<p>    $labels = array(<br \/>\n        &#8216;name&#8217;                =&gt; _x( &#8216;Products&#8217;, &#8216;Post Type General Name&#8217;, &#8216;text_domain&#8217; ),<br \/>\n    );<br \/>\n    $args = array(<br \/>\n        &#8216;label&#8217;               =&gt; __( &#8216;product&#8217;, &#8216;text_domain&#8217; ),<br \/>\n        &#8216;supports&#8217;            =&gt; array( &#8216;title&#8217;, &#8216;editor&#8217;, &#8216;publicize&#8217;, &#8216;wpcom-markdown&#8217; ),<br \/>\n    );<br \/>\n    register_post_type( &#8216;product&#8217;, $args );<\/p>\n<p>}<br \/>\n\/\/ Hook into the &#8216;init&#8217; action<br \/>\nadd_action( &#8216;init&#8217;, &#8216;custom_post_type&#8217;, 0 );<\/p>\n<p>If possible where must I insert the code?<\/p>\n","protected":false},"template":"","class_list":["post-1097516","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>Jetpack, How to use Publicize with your Custom Post Types -<\/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\/jetpack-how-to-use-publicize-with-your-custom-post-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jetpack, How to use Publicize with your Custom Post Types -\" \/>\n<meta property=\"og:description\" content=\"Hello, my question: can I use this function offers by jetpack? How to use Publicize with your Custom Post Types By default, Publicize is only triggered when you publish a new post. You can, however, extend this to other Custom Post Types. You have 2 options to add Publicize Support to a Custom Post Type: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-19T16:35:07+00:00\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/\",\"name\":\"Jetpack, How to use Publicize with your Custom Post Types -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-04-03T07:09:33+00:00\",\"dateModified\":\"2016-04-19T16:35:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/#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\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Jetpack, How to use Publicize with your Custom Post Types\"}]},{\"@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":"Jetpack, How to use Publicize with your Custom Post Types -","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\/jetpack-how-to-use-publicize-with-your-custom-post-types\/","og_locale":"en_US","og_type":"article","og_title":"Jetpack, How to use Publicize with your Custom Post Types -","og_description":"Hello, my question: can I use this function offers by jetpack? How to use Publicize with your Custom Post Types By default, Publicize is only triggered when you publish a new post. You can, however, extend this to other Custom Post Types. You have 2 options to add Publicize Support to a Custom Post Type: [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/","article_modified_time":"2016-04-19T16:35:07+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/","name":"Jetpack, How to use Publicize with your Custom Post Types -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-04-03T07:09:33+00:00","dateModified":"2016-04-19T16:35:07+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jetpack-how-to-use-publicize-with-your-custom-post-types\/#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":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Jetpack, How to use Publicize with your Custom Post Types"}]},{"@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\/1097516","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1097516\/revisions"}],"predecessor-version":[{"id":1098177,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1097516\/revisions\/1098177"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1097516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}