下記2パターンのうち、いずれかで。
カスタム投稿タイプ作成時に対応するパターン
wpcom-markdown
がマークダウンで publicize
がパブリサイズ共有。
<?php
// Register Custom Post Type
function my_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 );
}
add_action( 'init', 'my_custom_post_type', 0 );
「公開」になっているカスタム投稿タイプ全てに対応するパターン
wpcom-markdown
がマークダウンで publicize
がパブリサイズ共有。
<?php
add_action( 'init', 'my_custom_init' );
function my_custom_init() {
$args = array(
'public' => true,
'_builtin' => false
);
$output = 'names'; // names or objects, note names is the default
$operator = 'and'; // 'and' or 'or'
$post_types = get_post_types( $args, $output, $operator );
foreach ( $post_types as $post_type ) {
add_post_type_support( $post_type, array( 'publicize', 'wpcom-markdown' ) );
}
}