Shortcode Usage and Parameters

Subscribe2 uses a shortcode to display dynamic information to your readers. It can display the subscription form, messages about confirmation emails, prompts to login or visit subscription profiles and sometimes error messages.

The shortcode has several parameters built in that allow users of Subscribe2 to alter the default behavious of the [subscribe2] shortcode. This post aims to discuss those parameters.

Hide

The ‘hide’ parameter takes 2 possible inputs: ‘subscribe’ or ‘unsubscribe’. Once supplied with this parameter the plugin will hide that button on the subscription form. For example, to show the Subscribe2 form with only the ‘Subscribe’ button available use this shortcode:

[subscribe2 hide='unsubscribe']

ID

The ‘id’ parameter takes the number page ID of the WordPress page where you would like the user of your site to be directed when they have clicked Subscribe or Unsubscribe. Note, the Subscribe2 shortcode needs to be present on that redirected page to process the form input. For example:

[subscribe2 id='123']

NoJS

The ‘nojs’ parameter turns off the JavaScript that places the text ‘Enter Email Address…’ in the text box of the form and makes the textbox empty when it is clicked. The default is for JavaScript to be enabled. For example:

[subscribe2 nojs='true']

NoAntispam

The ‘noantispam’ parameter turns off the simple Anti Spam measures built into the plugin. The default is for AntiSpam to be enabled. For example:

[subscribe2 antispam='true']

Link

The ‘link’ parameter is intended for use when AJAX mode in enabled in the plugin settings. It defines the link text that is clicked to reveal the AJAX modal display. For example:

[subscribe2 hide='unsubscribe' link='Click here to Subscribe']

Size

The ‘size’ parameter controls the size of the input textbox for your users to enter their email address. The default value is 20. For example:

[subscribe2 size='30']

Wrap

The ‘wrap’ parameter allows the form buttons to be place on the same line as the text box rather than beneath it. By default ‘wrap’ is set to ‘true’. For example:

[subscribe2 wrap='false']