开发者 | aliakro |
---|---|
更新时间 | 2015年8月21日 04:34 |
捐献地址: | 去捐款 |
PHP版本: | 4.2.0 及以上 |
WordPress版本: | 4.2.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
On the page you require a Drip signup form, simply place the following shortcode: [drip-signup campaign_id="12345678"] The shortcode supports the following attributes: campaign_id - mandatory. This is the Drip Campaign that the visitor should be subscribed to. Read the FAQ section to get more information on getting a campaign ID. form_class - optional. The CSS class that should be applied to the form; this allows you to style the form as you wish via style sheets. Default: ''. placeholder_text - optional. The default placeholder text that appears in the email address text box. Default: 'Enter your email address'. button_text - optional. Specifies the text on the submit button. Default: 'Submit'. already_submitted_class - optional. Specifies the class that should be applied to the form if the user has already subscribed. Default 'yk-ds-hide-form' loader_colour - optional. Specifies the colour of the animated "loading" graphic. This allows you to contrast it against backgrounds. Default: '#000000' hide_another_element_on_page - optional. This attribute allows you to specify the ID of another HTML element on the page. When a form is submitted or a cookie has been detected, the css class specified by argument "already_submitted_class" will also be applied to given HTML element. For example this allows you to hide a div containging the form and other text. Default: none. Here is a full example: [drip-signup campaign_id="12345678" form_class="my-css-form-class" placeholder_text="Enter your email address" button_text="Subscribe" already_submitted_class="my-css-form-submitted" hide_another_element_on_page="id-of-another-html-element"]
If you wish to render a form via PHP, use the following sytnax: if (function_exists('yk_ds_shortcode')) { $shortcode_args = array( 'campaign_id' => 12345678, 'form_class' => 'my-css-form-class', 'placeholder_text' => 'Enter your email address', 'button_text' => 'Subscribe', 'already_submitted_class' => 'my-css-form-submitted', 'loader_colour' => '#000000', 'hide_another_element_on_page' => 'id-of-another-html-element' ); echo yk_ds_shortcode($shortcode_args); }
Once a user has subscribed to a form, a generic cookie is dumped. If detected, the class specified by already_submitted_class parameter is applied to the form. This means your form maybe getting hidden as the user has already subscribed. You can test this by ensuring your CSS doesn't cause elements with that class to be hidden.
By default cookies are set using PHP. This however may not work on some setups (for example due to caching). Therefore, you can specify that cookies are set via JavaScript. To do this, go to the admin page. Settings > Drip Ajax Signup. Ensure "Use JavaScript to set Cookies?" is set to "Yes".