Can’t see any hooks available for forcing or selecting a category automatically.
You could do it with jQuery however, it’s just not guaranteed to work for all users (they may have JS disabled as one example).
It’s still an option all the same.
add_action( 'admin_print_scripts-post.php', 'load_jquery_if_necessary' );
add_action( 'admin_print_scripts-post-new.php', 'load_jquery_if_necessary' );
add_action( 'admin_head-post.php', 'disable_and_check_cat' );
add_action( 'admin_head-post-new.php', 'disable_and_check_cat' );
function load_jquery_if_necessary() {
wp_enqueue_script( 'jquery' );
}
function disable_and_check_cat() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var required_cat = $('input#in-category-3');
if( required_cat )
required_cat.attr('disabled','disabled');
if( !required_cat.attr('checked') )
required_cat.attr('checked','checked');
});
</script>
<?php
}
Change the 3 for the category ID of the category you want selected and disabled.
For reference, this is the line that requires adjustment.
var required_cat = $('input#in-category-3');