我有示例代码:
<?php
$defaults = array(
\'show_option_all\' => \'\',
\'show_option_none\' => \'\',
\'orderby\' => \'id\',
\'order\' => \'ASC\',
\'show_count\' => 1,
\'hide_empty\' => 0,
\'child_of\' => 0,
\'exclude\' => \'\',
\'echo\' => 1,
\'selected\' => 1,
\'hierarchical\' => 1,
\'name\' => \'cat\',
\'id\' => \'mySelect\',
\'class\' => \'postform\',
\'depth\' => 0,
\'tab_index\' => 1,
\'taxonomy\' => \'category\',
\'hide_if_empty\' => false,
\'option_none_value\' => -1,
\'value_field\' => \'name\',
\'required\' => false,
);
wp_dropdown_categories( $defaults )
?>
Html将具有以下内容:
<option class="level-1" value="Name category 1">Name category 1 (38)</option>
如何在名称类别旁边显示术语ID,如下所示:
<option class="level-1" value="Name category 1">Name category 1 (ID-161) (38)</option>
谢谢你的帮助