Under Settings > Reading the user is given the option to set a front page and also a posts page, since these are independant features and have never been intended to share a single page (as outlined in the codex - ie. should never be set to the same page), could we include some simple jQuery to prevent the two dropdowns being set to the same values.
add_action( 'admin_head-options-reading.php' , 'postspage_frontpage_not_same' );
function postspage_frontpage_not_same() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($) {
// Get the current selected values
var wp_frontpage = $('#page_on_front option:selected').val();
var wp_postspage = $('#page_for_posts option:selected').val();
if( wp_postspage != '' ) {
$('#page_on_front').find('option[value=' + wp_postspage + ']').attr("disabled","disabled");
}
if( wp_frontpage != '' ) {
$('#page_for_posts').find('option[value=' + wp_frontpage + ']').attr("disabled","disabled");
}
// Attach a change function to the front page dropdown
$('#page_on_front').change(function() {
// Re-declare the variable for use inside the scope of the function
var wp_frontpage = $('#page_on_front option:selected').val();
if( wp_frontpage != '' ) {
// Find a matching option in posts page dropdown
$('#page_for_posts').find('option[value=' + wp_frontpage + ']').attr("disabled","disabled");
}
$('#page_for_posts').find('option[value!=' + wp_frontpage + ']:disabled').removeAttr('disabled');
});
// Attach a change function to the posts page dropdown
$('#page_for_posts').change(function() {
// Re-declare the variable for use inside the scope of the function
var wp_postspage = $('#page_for_posts option:selected').val();
if( wp_postspage != '' ) {
// Find a matching option in the front page dropdown
$('#page_on_front').find('option[value=' + wp_postspage + ']').attr("disabled","disabled");
}
$('#page_on_front').find('option[value!=' + wp_postspage + ']:disabled').removeAttr('disabled');
});
});
//]]>
</script>
<?php
}
The method above is perhaps a little hacky, but i'll happily provide a proper patch if the idea is supported, i'm posting a working sample here in the hope users will take the code and test it.
Let me know what you think.. :)