Conditional for User Age (Time since Registration)

Is there a conditional we can use so we can show different content depending how much time has passed since the user created an account?

I can’t find one.

Quick Temporary Solution: Treat new users as “subscribers” on conditionals and manually modify users that are “old enough” to a different role that’s also level 0.

:slightly_smiling_face:

Sounds like what you want is the s2member_eot function found in

s2member/src/includes/functions/api-functions.inc.php

I use it like this for the current users registration time.

$info = s2member_eot();
echo date('jS M Y', $info['time']);
1 Like

Thanks, but shouldn’t EOT mean end of subscription time?

I think we can echo the user registration time and even calculate the age on top of it, but I don’t see short code conditionals we can use.

Of course, it’s nothing essential, we can live without it and code around it with some research, but it would be neat to have it. :slightly_smiling_face:

True but there doesn’t seem to any additional functionality added to s2member since approx 2017, which is a super long time.

I’ve all sorts of amendments I’ve made over the years which would be super useful for other people immo.

You could use s2If with php enabled, and use the the registration days constant. https://www.s2member.com/codex/stable/s2member/api_constants/package-globals/#src_doc_S2MEMBER_CURRENT_USER_REGISTRATION_DAYS

Something like:

[s2If php="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS > 90"][/s2If]

Or the s2Drip shortcode… https://s2member.com/kb-article/s2drip-shortcode/

Like:

[s2Drip access="level0" from_day="90"][/s2Drip]

:slight_smile:

1 Like

That’s awesome! Thanks a lot!!

:slightly_smiling_face:

1 Like