| User | Post |
|
6:23 pm May 24, 2011
| Benjamin Allison
| | |
| |
|
|
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
| | |
| |
|
|
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
| | |
| |
|
|
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
| | |
| |
|
|
Wow that was fast!
Yeah your method is cleaner. I like clean. :)
Thanks so much!
|
|