0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

改 カスタムタクソノミーで選択を強制にする

Posted at
//カスタムタクソノミーで選択を強制にする
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>';
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?