Created
August 6, 2023 09:42
-
-
Save Rupashdas/21d406efa3251c770541461f2e4dbcdd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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