php - How can I show usermeta check box value if checked -
i’m using code in form template collects usermeta info on wordpress install.
$fields = array(); $fields[] = new pmprorh_field("agree", "checkbox", array("profile"=>true, "label"=>"agree", "options"=>array(""=>"agree"))); foreach($fields $field) pmprorh_add_registration_field("after_email", $field);
and i’m using display usermeta info in custom author template outside of loop.
<?php echo $curauth->agree; ?>
the problem in author template, entry shows “1” if checked , “0” if unchecked. text fields, radio fields, , select fields seem capture entry value i'm looking for. need echo value checkbox, not fact checked.
well value either 1 or 0 can of course of study swop whatever want
e.g.
if($curauth->agree): $curauth->agree='agree'; else: $curauth->agree='dont agree'; endif;
php wordpress checkbox
No comments:
Post a Comment