Skip to content

Instantly share code, notes, and snippets.

@codescribblr
Created April 27, 2015 16:26
Show Gist options
  • Select an option

  • Save codescribblr/d5142dac023ed72911b6 to your computer and use it in GitHub Desktop.

Select an option

Save codescribblr/d5142dac023ed72911b6 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
//<![CDATA[
jQuery(function($)
{
function my_check_categories()
{
$('#_custom_meta_metabox').hide();
$('#categorychecklist input[type="checkbox"]').each(function(i,e)
{
var id = $(this).attr('id').match(/-([0-9]*)$/i);
id = (id && id[1]) ? parseInt(id[1]) : null ;
if ($.inArray(id, [4,3]) > -1 && $(this).is(':checked'))
{
$('#_custom_meta_metabox').show();
}
});
}
$('#categorychecklist input[type="checkbox"]').live('click', my_check_categories);
my_check_categories();
});
//]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment