ある程度の創造性があれば、そうです、それは可能です:)
別のショートコードを作成して、「仮想」JetPackショートコードを作成します。
デフォルトのpostpost_typeを使用してこれをテストしました。
add_shortcode( 'my-jet-form', 'so_14003883_jet_form' );
function so_14003883_jet_form( $atts, $content )
{
// Query our post type, change accordingly
$posts = get_posts( array(
'post_type' => 'post',
'numberposts' => -1,
'post_status' => 'publish'
) );
// Build an array of post titles
$titles = array();
foreach( $posts as $post )
{
$titles[] = $post->post_title;
}
// Convert array into comma sepparated string
$posts_select = implode( ',', $titles );
// Make JetPack shortcode
$return = do_shortcode( '[contact-form][contact-field label="Name" type="name" required="1"/][contact-field label="Artist" type="select" options="' . $posts_select . '"/][/contact-form]' );
return $return;
}
使用法:
- 希望の投稿タイプを調整します
do_shortcode
元のショートコードに合うようにパーツを調整します
[my-jet-form]
ショートコードを好きな場所に置いてください
- voilà