Source Code Documentation


Source Code Documentation ( Packages )

Packages are only used to organize (i.e. group) classes/functions/globals/constants together logically. Although PHP v5.3+ supports the concept of Namespaces (i.e. Packages), this software does not require that type of usage. All Classes contained within this software are top-level. In other words, you don't need to reference any particular Package within code. Again, at this time, Packages are only used to improve organization within this documentation.


The free version of s2Member®, is referred to as the s2Member® Framework. It supports PayPal® Standard Button integration through WordPress® Shortcodes. Suitable for most sites.

This documentation also covers routines introduced by s2Member® Pro (an optional paid upgrade). s2Member® Pro adds support for PayPal® Pro, Authorize.Net®, Google® Checkout, and ClickBank®. In addition, s2Member® Pro includes User Import/Export tools, Coupon Codes, and a Pro Login Widget (plus Profile Summary). Your purchase of s2Member® Pro includes free upgrades via s2Member.com (new features, bug fixes, updates, improvements), along with full access to our video tutorial library.

See Also:
full description ( below )
( All 69 Packages )
Packages
s2MemberCore Package for the s2Member plugin. ( 140 Hooks/Filters )
s2Member\API_ConstantsEasy API Constants for site owners to use in their own projects. ( 4 Hooks/Filters )
s2Member\API_FunctionsEasy API Functions for site owners to use in their own projects. ( 1 Hook/Filter )
s2Member\API_Remote_OpsEasy API Operations for site owners to use in their own projects. ( 2 Hooks/Filters )
s2Member\Admin_CSS_JSAdministrative CSS/JS for menu pages. ( 6 Hooks/Filters )
s2Member\Admin_LockoutsLocks Users/Members out of admin panels. ( 5 Hooks/Filters )
s2Member\Admin_NotesAdministrative notes. ( 6 Hooks/Filters )
s2Member\Admin_NoticesEnqueue/display administrative notices. ( 10 Hooks/Filters )
s2Member\AliPayAliPay® integration classes. ( 0 Hooks/Filters )
s2Member\AuthNetAuthorize.Net® integration classes. ( 21 Hooks/Filters )
s2Member\Auto_EOT_SystemAuto-EOT System (EOT = End Of Term). ( 19 Hooks/Filters )
s2Member\Brute_ForceBrute Force protection classes. ( 6 Hooks/Filters )
s2Member\CSS_JSCSS/JS classes for s2Member. ( 13 Hooks/Filters )
s2Member\Caches2Member's caching classes. ( 2 Hooks/Filters )
s2Member\CategoriesCategory protection classes. ( 8 Hooks/Filters )
s2Member\ClickBankClickBank® integration classes. ( 0 Hooks/Filters )
s2Member\Cron_JobsCron routines handled by s2Member. ( 5 Hooks/Filters )
s2Member\Custom_Reg_FieldsCustom Registration Fields. ( 64 Hooks/Filters )
s2Member\Email_ConfigsEmail configurations for s2Member. ( 23 Hooks/Filters )
s2Member\ExportsVarious exportation classes. ( 2 Hooks/Filters )
s2Member\FilesFile Download classes. ( 28 Hooks/Filters )
s2Member\GatewaysLoading routines for Payment Gateways. ( 2 Hooks/Filters )
s2Member\GoogleGoogle® Checkout integration classes. ( 0 Hooks/Filters )
s2Member\IP_RestrictionsIP Restriction classes. ( 21 Hooks/Filters )
s2Member\ImportsVarious importation classes. ( 1 Hook/Filter )
s2Member\InstallationInstallation classes for s2Member. ( 7 Hooks/Filters )
s2Member\List_ServersList Server integrations. ( 30 Hooks/Filters )
s2Member\Lock_Iconss2Member Lock Icon classes. ( 12 Hooks/Filters )
s2Member\Login_CustomizationsLogin/Registration customizations. ( 14 Hooks/Filters )
s2Member\Login_RedirectsLogin redirections. ( 19 Hooks/Filters )
s2Member\Main_Multisite_PatchesMain Multisite patches. ( 7 Hooks/Filters )
s2Member\Membership_Options_PageMembership Options Page. ( 6 Hooks/Filters )
s2Member\Menu_PagesAdministrative menu pages. ( 543 Hooks/Filters )
s2Member\Meta_BoxesAdministrative meta boxes. ( 8 Hooks/Filters )
s2Member\New_UsersNew User, administrative handlers. ( 34 Hooks/Filters )
s2Member\No_CacheNo-cache classes. ( 10 Hooks/Filters )
s2Member\Option_ForcesForces WordPress® options. ( 14 Hooks/Filters )
s2Member\Option_NoticesOption panel notices. ( 9 Hooks/Filters )
s2Member\PagesPage protection classes. ( 8 Hooks/Filters )
s2Member\PayPalPayPal® integration classes. ( 211 Hooks/Filters )
s2Member\PostsPost protection classes. ( 8 Hooks/Filters )
s2Member\ProfilesUser/Member Profile classes. ( 41 Hooks/Filters )
s2Member\QueriesQuery protection classes. ( 13 Hooks/Filters )
s2Member\ReadmesReadme file parsing classes. ( 6 Hooks/Filters )
s2Member\RegistrationsRegistration classes/handlers. ( 48 Hooks/Filters )
s2Member\Return_TemplatesThank-You Page Return templates. ( 8 Hooks/Filters )
s2Member\Roles_CapsConfiguration of Roles/Capabilities. ( 11 Hooks/Filters )
s2Member\SP_AccessSpecific Post/Page Access. ( 11 Hooks/Filters )
s2Member\SSLSSL classes for s2Member. ( 18 Hooks/Filters )
s2Member\Securitys2Member's Security Gate. ( 4 Hooks/Filters )
s2Member\Security_Badgess2Member Security Badges. ( 5 Hooks/Filters )
s2Member\SystematicsSystematic conditional classes. ( 6 Hooks/Filters )
s2Member\TagsTag protection classes. ( 8 Hooks/Filters )
s2Member\TrackingTracking classes. ( 19 Hooks/Filters )
s2Member\TranslationsTranslation classes. ( 3 Hooks/Filters )
s2Member\URIsURI protection classes. ( 10 Hooks/Filters )
s2Member\Upgraders2Member upgrade wizard classes. ( 4 Hooks/Filters )
s2Member\User_AccessUser access classes. ( 5 Hooks/Filters )
s2Member\User_DeletionsUser deletion classes. ( 11 Hooks/Filters )
s2Member\User_SecuritiesUser security classes. ( 8 Hooks/Filters )
s2Member\Users_ListWordPress® Users list. ( 50 Hooks/Filters )
s2Member\Utilitiess2Member utility classes. ( 11 Hooks/Filters )
s2Member\WP_FooterWordPress® footer classes. ( 2 Hooks/Filters )
s2Member\WidgetsWidget loading routines & classes. ( 14 Hooks/Filters )
s2Member\ccBillccBill® integration classes. ( 2 Hooks/Filters )
s2Member\s2FileShortcode [s2File /] classes. ( 6 Hooks/Filters )
s2Member\s2GetShortcode [s2Get /] classes. ( 3 Hooks/Filters )
s2Member\s2IfShortcode [s2If /] classes. ( 4 Hooks/Filters )
s2Member\s2KeyShortcode [s2Key /] classes. ( 3 Hooks/Filters )

The free version of s2Member®, is referred to as the s2Member® Framework. It supports PayPal® Standard Button integration through WordPress® Shortcodes. Suitable for most sites.

This documentation also covers routines introduced by s2Member® Pro (an optional paid upgrade). s2Member® Pro adds support for PayPal® Pro, Authorize.Net®, Google® Checkout, and ClickBank®. In addition, s2Member® Pro includes User Import/Export tools, Coupon Codes, and a Pro Login Widget (plus Profile Summary). Your purchase of s2Member® Pro includes free upgrades via s2Member.com (new features, bug fixes, updates, improvements), along with full access to our video tutorial library.

Hacking s2Member® (it's easy with Hooks/Filters for WordPress®)

If you need to add custom processing routines, or modify the behavior of existing processing routines; please use s2Member's Hooks/Filters for WordPress®. Hooks & Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member® plugin files directly. This way you won't need to merge your changes/tweaks each time a new version of s2Member® is released. To create custom processing routines, place those routines into a PHP file here: /wp-content/mu-plugins/s2-hacks.php. If you don't have an /mu-plugins/ directory, please create one. These are (mu) MUST USE plugins, which are loaded into WordPress® automatically; that's what you want! If you're not familiar with Hooks/Filters for WordPress®, please read this article in the WordPress® Codex.

Adding a Hook (inside /wp-content/mu-plugins/s2-hacks.php)

Please make sure there are NO blank lines in your PHP file. Do NOT introduce spaces/tabs/lines before or after the <?php ?> tags.

  1. <?php
  2. add_action("hook_name", "my_action_hook_function");
  3. function my_action_hook_function($vars = array())
  4. {
  5. echo "My Hook works.";</p><p> # Optional. s2Member® passes you an array of defined variables.
  6. # print_r($vars); # Would give you a list of defined variables.
  7. # These are PHP variables defined within the scope of the Hook,
  8. # at the precise point in which the Hook is fired by s2Member®.</p><p> # $vars["__refs"] are also included (with some Hooks).
  9. # These are internal PHP variable references (very useful).
  10. # To learn all about references, please see PHP documentation:
  11. # http://www.php.net/manual/en/language.references.pass.php
  12. }
  13. ?>

Adding a Filter (inside /wp-content/mu-plugins/s2-hacks.php)

Please make sure there are NO blank lines in your PHP file. Do NOT introduce spaces/tabs/lines before or after the <?php ?> tags.

  1. <?php
  2. add_filter("filter_name", "my_filtering_function", 10, 2);
  3. function my_filtering_function($original_value, $vars = array())
  4. {
  5. if($original_value !== "something I like")
  6. return ($my_custom_value = "My Filter works.");</p><p> else # Return original value.
  7. return $original_value;</p><p> # Optional. s2Member® passes you an array of defined variables.
  8. # print_r($vars); # Would give you a list of defined variables.
  9. # These are PHP variables defined within the scope of the Filter,
  10. # at the precise point in which the Filter is fired by s2Member®.</p><p> # $vars["__refs"] are also included (with some Filters).
  11. # These are internal PHP variable references (very useful).
  12. # To learn all about references, please see PHP documentation:
  13. # http://www.php.net/manual/en/language.references.pass.php
  14. }
  15. ?>


Source Code Documentation