Page 1 of 1

Shortcodes

PostPosted: August 17th, 2010, 9:12 am
by eshanfelt
I have the s2Member Pro developer license. I've seen the scripting/API section, but am wondering if there are shortcodes for many of the PHP functions listed in that section. On my member "welcome" page, I'd like to put a link to modify the profile. I see the various PHP options, but cannot (and don't want to) have PHP in a WordPress post or page.

How can I get the following into a shortcode?
Code: Select all
<a href="#" onclick="if(!window.open('<?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; ?>',
'_popup', 'height=350,width=400,left=100,screenX=100,top=100,screenY=100,
location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1'))
alert('Please disable popup blockers and try again!');
return false;">Modify Profile</a>

Re: Shortcodes

PostPosted: August 17th, 2010, 3:03 pm
by Jason Caldwell
Hi there. Great question.

There are two ways that I'm aware of.

1. You could hard-code the link. It's always:
Code: Select all
http://path/to/wordpress/?s2member_profile=1

2. You could use this plugin, to create a Shortcode out of that snippet:
http://wordpress.org/extend/plugins/shortcode-exec-php/