Bare with me as I explain this. I'm adding an Assistant Editor feature to my multiple author platform. In the box that appears in post-edit page, the Editors can tick which task that they have done (for instance proofread the article) and then check their username (so that they will be credited on the front post page). The box looks something like this:

The code for the box:
// author checkboxes
add_action( 'add_meta_boxes', 'assisting_editor' );
function assisting_editor() {
add_meta_box(
'assisting_editor', // id, used as the html id att
__( 'Editorial Tasks' ), // meta box title
'editor_tasks', // callback function, spits out the content
'post', // post type or page. This adds to posts only
'side', // context, where on the screen
'low' // priority, where should this go in the context
);
}
function editor_tasks( $post ) {
global $wpdb;
$value = get_post_meta($post->ID, 'ratings', true);
echo '<div class="misc-pub-section misc-pub-section-last"><span id="timestamp"><label>Editorial tasks: </label>';
$ratings = array(
1 => ' Proofread ',
2 => ' Graphics Added ',
3 => ' SEO Fixed ',
4 => ' Ready for Publish '
);
foreach ($ratings as $id => $text) {
$checked = (in_array($id,(array)$value)) ? ' checked="checked"' : '';
echo '<input type="checkbox" name="ratings[]" value="' . $id . '"'. $checked . '/><label for="ratings[]">'.$text.'</label>';
}
$qry['relation'] = 'OR';
$qry[] = array(
'key' => $wpdb->prefix.'capabilities',
'value' => 'editor',
'compare' => 'like'
);
$qry[] = array(
'key' => $wpdb->prefix.'capabilities',
'value' => 'administrator',
'compare' => 'like'
);
$qry = array('fields' => 'all_with_meta','meta_query'=>$qry);
$alleds = get_users($qry);
$currenteds = get_post_meta($post->ID, 'currenteds', true);
foreach ($alleds as $ed) {
$checked = (in_array($ed->ID,(array)$currenteds)) ? ' checked="checked"' : '';
echo '<input type="checkbox" name="currenteds[]" value="' . $ed->ID . '"' .$checked . '"/><label for="ratings[]">'.$ed->user_nicename.'</label>';
}
echo '</span></div>';
}
add_action( 'save_post', 'save_metadata');
function save_metadata($postid)
{
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false;
if ( !current_user_can( 'edit_page', $postid ) ) return false;
if( empty($postid) ) return false;
if ( is_null($_REQUEST["ratings"]) ) {
delete_post_meta($postid, 'ratings');
} else {
update_post_meta($postid, 'ratings', $_REQUEST['ratings']);
}
if ( is_null($_REQUEST["currenteds"]) ) {
delete_post_meta($postid, 'currenteds');
} else {
update_post_meta($postid, 'currenteds', $_REQUEST['currenteds']);
}
}
function display_current_eds($ID = '') {
if (empty($ID)) {
global $post;
if (!empty($post)) {
$ID = $post->ID;
}
}
if (empty($ID)) return false;
$eds = get_post_meta($post->ID,'currenteds',true);
if (!empty($eds)) {
foreach ($eds as $e) {
$edu = get_userdata($e);
$edusers[] = sprintf(
'<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
get_author_posts_url( $edu->ID, $edu->user_nicename ),
esc_attr( sprintf( __( 'Posts by %s' ), $edu->user_nicename ) ),
$edu->user_nicename
);
}
return $edusers;
}
return false;
}
function authors_content_filter($content) {
$authors = display_current_eds();
if (false !== $authors) {
$content .= implode(', ',$authors);
}
return $content;
}
add_filter('the_content','authors_content_filter');
// add author checkboxes
Now, the problem is that the user can tick his own name and any of the other editors. This means that the user can as well untick any of the names too. That is not good.
My question is, how do I make it so that the user can only tick his own name and the other names are greyed out?
