タクソノミーのカテゴリを強制チェックさせる

//カスタムタクソノミーで選択を強制にする
add_action('admin_print_footer_scripts', 'admin_print_footer_scripts_custom', 21);
function admin_print_footer_scripts_custom() {
    echo '<script type="text/javascript">
      //<![CDATA[
      jQuery(document).ready(function($){
          // default check
          if ($(".categorychecklist input[type=checkbox]:checked").length == 0) {
            $(".categorychecklist > li:first-child > .selectit > input").attr("checked", "checked");
          }
      });
      //]]>
      </script>';
}
            $(".categorychecklist > li:first-child > .selectit > input").attr("checked", "checked");

ここを改造した
> で指定する場合かならず具体的でなければならない。
途中一個でも抜けるとおもった指示が書けない

今回は一個目のリストの小ulリストのインプットまでかかってしまうため
おやから順次具体的にしていして
小カテゴリは強制チェックさせないようにした。

参考 cssセレクタ42個
http://wp-e.org/2014/05/20/2420/

http://qiita.com/seltzer/items/899b1cbe636743f2915e

add_action('admin_print_footer_scripts', 'admin_print_footer_scripts_custom', 21);
function admin_print_footer_scripts_custom() {
    echo '<script type="text/javascript">
      //<![CDATA[
      jQuery(document).ready(function($){
          // default check
          if ($(".categorychecklist input[type=checkbox]:checked").length == 0) {
            $(".categorychecklist li:first-child input:first-child").attr("checked", "checked");
          }
      });
      //]]>
      </script>';
}