Support Forum

 
Current User: Guest
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Adding conditional statement (if has accepted) into theme?

Information/How to
UserPost

6:23 pm
May 24, 2011


Benjamin Allison

 
1

Great plugin! So elegant!

 

Just wondering what the most efficient way to check if a user has agreed to the terms would be, as far as theme integration goes. For example:

 

if ( has_agreed() ){

runThis();

} else if ( !has_agreed() ){

runThat();

}

 

Thanks!

6:37 pm
May 24, 2011


Benjamin Allison

 
2

Found my own solution!

 

<?php global $user_ID, $tou_settings; ?>
<?php if (!TouAppHelper::get_user_meta($user_ID, 'terms_and_conditions')) {?>
Is this the most elegant method?
Thanks!

6:41 pm
May 24, 2011


Steph

 
3

The function you found is a bandiad to cover WP 2.9 as well as earlier releases. The cleanest way might be:

global $current_user;

if($current_user->terms_and_conditions){

…..

 

But if this doesn't work for you, your solution looks great too, although you can remove the TouAppHelper:: part if you are using at least WP 2.9.

6:49 pm
May 24, 2011


Benjamin Allison

 
4

Wow that was fast!

 

Yeah your method is cleaner. I like clean. :)

 

Thanks so much!

Information/How to

Reply to Topic:
Adding conditional statement (if has accepted) into theme?

Guest Name (Required):

Guest Email (Required):

Smileys
Cool Surprised Smile Wink Laugh Confused Cry Embarassed Frown
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
11 + 9
   


Information/How to