我尝试在DIVI主题的生成器中添加项目列表。
我已成功插入project\\u标记列表,如下所示:
<div class="et-pb-option">
<label for="et_pb_project_tag">Choisir le(s) réalisateur(s): </label>
<div class="et-pb-option-container">
<% var et_pb_include_project_tag_temp = typeof et_pb_include_project_tag !== \'undefined\' ? et_pb_include_project_tag.split( \',\' ) : []; %>
END;
$tag_array = get_terms( \'project_tag\' );
foreach ( $tag_array as $tag ) {
printf( \'<label><input type="checkbox" name="et_pb_include_project_tag" value="%1$s"%3$s> %2$s</label><br/>\',
esc_attr( $tag->term_id ),
esc_html( $tag->name ),
\'<%= _.contains( et_pb_include_project_tag_temp, "\' . $tag->term_id . \'" ) ? checked="checked" : "" %>\'
);
}
echo <<<END
<p class="description">Sélectionner le réalisateur.</p>
</div> <!-- .et-pb-option-container -->
</div> <!-- .et-pb-option -->
但我不知道如何处理父自定义类型“project”有什么建议吗?