I fell asleep last night thinking about this problem and I realized that I could use JavaScript to achieve what I wanted: First, I hide the submit button using CSS, then I submit the form using JavaScript by adding onClick to the link HTML.
However, before I can do any of that, I need to give the s2Member form a name. Both the shortcode-generated form and the HTML provided by the button generator don't have a form a name.
How to Create an HTML link that submits Subscribe buttonsUpdate: As Cristián points out below, this can be achieved using the
output="url" shortcode option (read more here:
WP Admin -> s2Member -> PayPal Button -> Shortcode Attributes).
By changing the output option to 'url', the shortcode will return a raw URL that we can then use in an anchor tag to create a link:
- Code: Select all
<a href="[s2Member-PayPal-Button level="1" ccaps="" desc="Raam's Journal ($5/month)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="raamdev.com" ta="0" tp="0" tt="D" ra="5.00" rp="1" rt="M" rr="1" rrt="" rra="1" image="default" output="url" /]">Subscribe to the Journal ($5/month)</a>
When the post is published, that code turns into a link that allows my reader to subscribe to my journal: