WordPress.org

Ready to get started?Download WordPress

Forums

s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Using Current User Registration Days in a formula (1 post)

  1. scottgoldsmith
    Member
    Posted 6 months ago #

    I seem to be having issues using Current User RegistrationDays in a formula. I've been able to use other S2Get User fields in formulas on my pages. Posting [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /] displays the proper number of days. However, I'd like to get the total weeks that the user has been registered and be able to use this as a variable.

    Here's an example of my code that doesn't seem to be working. I've tried playing with the structure of the [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /] request to no avail.

    <script>
    var User_days = [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /];
    var User_weeks = (User_days/7);
    document.write(User_weeks);
    </script>

    http://www.s2member.com/codex/stable/s2member/api_constants/package-globals/#src_doc_S2MEMBER_CURRENT_USER_REGISTRATION_DAYS

    https://wordpress.org/plugins/s2member/

Reply

You must log in to post.