Skip to content

Instantly share code, notes, and snippets.

@sareiodata
Created October 9, 2012 14:39
Show Gist options
  • Save sareiodata/3859240 to your computer and use it in GitHub Desktop.
Save sareiodata/3859240 to your computer and use it in GitHub Desktop.
$current_user = wp_get_current_user();
if ( 0 == $current_user->ID ) {
// Not logged in. Can't comment
} else {
$birthday = get_user_meta($current_user->ID, 'birthday-your-unique-slug', true);
if ($birthday >= 18) {
//display comment form
} else {
// DO NOT display comment form
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment