Subscribe2, just like WordPress, provides several API (Application Programming Interface) hooks to allow users and developers to modify the way the plugin works. This page aims to document the available hooks.
Articles
- s2_excerpt_lengththis hook allows the length of the default excerpt to be modified. the default is approximately 55 words.Updated
- s2_email_subjectthis hook allows the email subject to be changed at the point of sending.Updated
- s2_post_typesthis hook allows the registration of Custom Post Types in Subscribe2 so that notifications can be sent for new posts created in such a custom post type.Updated
- s2_post_statusesthis hook allows the registration of custom post statuses in Subscribe2 so that notifications can be sent for transitions from these statuses to publishedUpdated
- s2_taxonomiesthis hook allows the registration of Custom Taxonomies in Subscribe2 so that notifications assigned to such custom taxonomies can still generate an emailUpdated
- s2_capabilityThis hook allows access to the Subscribe2 menu pages to be restricted or relaxed as users see fit.Updated
- s2_admin_emailSubscribe2 can be configured to send an email to all Administrator level users every time a public subscriber subscriber or unsubscribes.Updated
- s2_clean_intervalVersion 9.0 of Subscribe2 introduced an automated cleaning feature that deletes unconfirmed public subscribers from the database 28 days after the emailUpdated
- s2_reminder_intervalVersion 10.10 of Subscribe2 introduced an automated reminder email feature that sends a reminder email to unconfirmed public subscribers two days after theUpdated
- s2_send_plain_excerpt_subscribers s2_send_plain_fullcontent_subscribers s2_send_html_excerpt_subscribers s2_send_html_fullcontent_subscribersThese hooks allow the list of recipients (who will be Registered Subscribers) to be amended immediately prior to the email notification being sent.Updated
- s2_subscribe_confirmedThis allows the message displayed to a newly subscribing user that is displayed (after clicking the confirmation link in their email) to be customised.Updated
- s2_unsubscribe_confirmedThis allows the message displayed to a newly unsubscribing user that is displayed (after clicking the confirmation link in their email) to be customised.Updated
- s2_confirm_emailIntroduced in version 9.1.Updated
- s2_confirm_linkallows the base URL for confirmation links to be changed.Updated
- s2_subscribe_button s2_unsubscribe_buttonThese hooks allow the default button text to be changed without editing the code or any used translation files.Updated
- s2_formThis hook allows the Subscribe2 form output to be dynamically altered to suit the needs of an individual site.Updated
- s2_ajax_formThis hook allows the Subscribe2 form output to be dynamically altered to suit the needs of an individual site but applies only to the AJAX popup form.Updated
- s2_authorsThis hook allows the display list of content authors to be refined.Updated
- s2_html_email s2_plain_email s2_digest_emailThese hooks allow the entire content of the email to be filter and amended immediately prior to sending.Updated
- s2_word_wrapby default Subscribe2 wraps the plain text emails at a count of 78 characters.Updated
- s2_jqueryui_cssWhen AJAX mode is enabled in Subscribe2 the usual form is replaced by a jQuery UI mods box. jQuery UI has many CSS themes to choose from and this hook allowsUpdated
- s2_email_headersThis hook allows you to alter or remove the email headers subscribe2 uses at the time of sending.Updated
- s2_email_templateThis hook allow you to manipulate the email template without editing it in the settings. as an example, it may prove useful on Multisite installs to add siteUpdated
- s2_allow_site_switchingThis hook is for Multisite installs.Updated
- s2_social_linksThis hook was introduced in version 9.3 of Subscribe2.Updated
- s2_custom_keywordsThis hook was introduced in version 9.3 of Subscribe2.Updated
- s2_public_subscriber_formatThis hook is available in Subscribe2 HTML only.Updated
- s2_lockoutEach time the form is used to subscribe a new email address the IP address is logged.Updated
- s2_image_sizeThis hook allows images inserted to replace the {IMAGE} keyword to be resized.Updated
- s2_unsublink_public s2_unsublink_registeredThese hooks allow site specific styling and text wrapping to be applied to the URI links generated by the {UNSUBLINK} keyword.Updated
- s2_sanitize_emailThis hook allows email address passed through the Subscribe2 HTML sanitise_email() function to be filtered.Updated
- s2_remote_embed_hostThis hook allows control over embedding of images from remote hosts when generating emails.Updated
- s2_subscriber_dropdown_defaultThis hook allows the default selection in the subscriber drop down on the Send Email page to be changed.Updated
- s2_captcha_elementIntroduced in Version 11, this filter allows adjustments to be made to the display of the ReCaptcha form element if needed.Updated
- s2_recaptcha_langIntroduced in Version 11, this filter allows the preferred language for the ReCaptcha for element to be changed.Updated
- s2_excerpt_on_wordsIntroduced in Version 11.5, this filter allows the excerpt to be generated on character count rather than words.Updated
Last updated on
Filed under Subscribe2