PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
[s2If current_user_is(s2member_level0) AND (what conditional statement would go here in order to validate that the registration field entered was female?)]
Content for logged in user who is female goes here
[/s2If]
<?php
//This gets the user fields
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
//Then, use the $fields variable to get your data.
$fields["my_unique_field_id"];//Replace this with yours.
?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_is('s2member_level0') && $fields["user_gender"] === 'female')
{?>
Things for females
<?php}else if (current_user_is('s2member_level0') && $fields["user_gender"] === 'male'){?>
Things for males
<?php}else{?>
Things for non-members
<?php}?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_is('s2member_level0') && $fields["Gender"] === 'female')
{
?>
Things for females
<?php
}
else if (current_user_is('s2member_level0') && $fields["Gender"] === 'male')
{
?>
Things for males
<?php
}
else
{
?>
Things for non-members
<?php
}
?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
$fields["custom_field"];
?>
<?php
$fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
if (current_user_can('access_s2member_level0') && $fields["custom_field"] === 'field_value')
{
?>
Content for this condition goes here.
<?php
}
else if (current_user_can('access_s2member_level0') && $fields["custom_field"] === 'another_field_value')
{
?>
Content for this other condition goes here.
<?php
}
else
{
?>
Dump public content here, or add additional conditions.
<?php
}
?>
Users browsing this forum: No registered users and 1 guest