latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Shortcode for user role

Home Forums Community Forum Shortcode for user role

Tagged: 

This topic contains 3 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 18th, 2012 at 11:33 am #28849
Rami Y
Username: rami

Hi, i want to create a page with all the paiment information.

Are there a shortcodes to show:

1.) User Role Label ?
2.) Registration Date ?
1.) Experation Date ?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Thursday Oct 18th, 2012 at 12:59 pm #28866
Eduan
Username: Eduan
Moderator

Hello Rami,

Have you searched under Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants? You might find what you need there.

Hope this helps. :)

Posted: Friday Oct 19th, 2012 at 7:43 am #28979
Rami Y
Username: rami

Ok, thanks. found it.

Posted: Friday Oct 19th, 2012 at 7:47 am #28982

Right, the constants documentation will help you. [hilite path]Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants[/hilite]

1.) User Role Label ?
2.) Registration Date ?
1.) Experation Date ?

[hilite pre_code]
S2MEMBER_LEVELn_LABEL
S2MEMBER_CURRENT_USER_ACCESS_LABEL
S2MEMBER_CURRENT_USER_REGISTRATION_TIME
[/hilite]

You can use the [hilite mono][[s2Get constant="NAME_OF_CONSTANT" /]][/hilite] shortcode. For example, you might use [hilite code][[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]][/hilite] to display the type of Membership a Customer has. The [s2Get constant="" /] Shortcode will work for any of the s2Member constants.

For expiration time (EOT: end of term), you’d use the [hilite mono]get_user_field[/hilite] function. http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_get_user_field%28%29

[hilite pre_code]
$s2member_auto_eot_time = get_user_field ("s2member_auto_eot_time"); # Auto EOT-Time for the current User ( when applicable ).
[/hilite]

I hope that helps. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.