Skip to content

Instantly share code, notes, and snippets.

@Rupashdas
Created August 6, 2023 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rupashdas/21d406efa3251c770541461f2e4dbcdd to your computer and use it in GitHub Desktop.
Save Rupashdas/21d406efa3251c770541461f2e4dbcdd to your computer and use it in GitHub Desktop.
<script>
(function($){
$(document).ready(function(){
$('#divisiondiv .selectit').on('click', function(event){
var targetElement = event.target;
if($(targetElement).prop("tagName") == 'INPUT'){
var elements = $('#divisiondiv .selectit').find('input[type="checkbox"]');
$(elements).each(function(){
if(targetElement != this){
$(this).prop("checked", false);
}
});
}
});
});
})(jQuery);
</script>
<?php
function er_snell_admin_script($hook) {
global $post_type;
if(($hook == "post.php" || $hook == "post-new.php") && $post_type == 'project'){
wp_enqueue_script( 'project-admin', get_theme_file_uri("assets/js/admin-post.js"), array('jquery'), VERSION, true );
}
}
add_action( 'admin_enqueue_scripts', 'er_snell_admin_script');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment