By default, Jetpack’s 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:
- 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 or directly modifying the theme’s functions.php file. (carefully)
add_action(‘init’, ‘my_custom_init’);
function my_custom_init() {
add_post_type_support( ‘product’, ‘publicize’ );
}
You’ll need to replace “product” with your Custom Post Type name.
2. You can add Publicize support when registering the post type:
// Register Custom Post Type
function custom_post_type() {
$labels = array(
‘name’ => _x( ‘Products’, ‘Post Type General Name’, ‘text_domain’ ),
);
$args = array(
‘label’ => __( ‘product’, ‘text_domain’ ),
‘supports’ => array( ‘title’, ‘editor’, ‘publicize’, ‘wpcom-markdown’ ),
);
register_post_type( ‘product’, $args );
}
// Hook into the ‘init’ action
add_action( ‘init’, ‘custom_post_type’, 0 );