s2Member v110815
Package s2Member\API_Functions ( Summary )
Docs updated: August 15, 2011, 2:27 pm
Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Summary Functions Hooks/Filters Package s2Member\API_Functions ( Summary ) Easy API Functions for site owners to use in their own projects. See Also: full description ( below ) ( 32 Functions )Function Summary S2MEMBER_VALUE_FOR_PP_INV() Can be used to auto-fill the invoice for PayPal® Button Codes, with a unique Code~IP combination. attach_s2member_query_filters() Allows plugin/theme developers to pre-filter WP Queries easily, so that protected content ( i.e content NOT available to the current User ), is excluded automatically. current_user_cannot() Conditional to determine if the current User does NOT have a specific Capability or Role. current_user_cannot_for_blog() Conditional to determine if the current User does NOT have a specific Capability or Role, on a specific Blog within a Multisite Network. current_user_is() Conditional to determine if the current User is/has a specific Role. current_user_is_for_blog() Conditional to determine if the current User is/has a specific Role, on a specific Blog within a Multisite Network. current_user_is_not() Conditional to determine if the current User is/does NOT have a specific Role. current_user_is_not_for_blog() Conditional to determine if the current User is/does NOT have a specific Role, on a specific Blog within a Multisite Network. detach_s2member_query_filters() Allows plugin/theme developers to pre-filter WP Queries easily, so that protected content ( i.e content NOT available to the current User ), is excluded automatically. get_user_field() A powerful function that can retrieve almost anything you need to know about the current User, and/or a particular User. is_category_permitted_by_s2member() Conditional to determine if a specific Category is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_category_protected_by_s2member() Conditional to determine if a specific Category is protected by s2Member; without considering the current User's Role/Capabilites. is_page_permitted_by_s2member() Conditional to determine if a specific Page is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_page_protected_by_s2member() Conditional to determine if a specific Page is protected by s2Member; without considering the current User's Role/Capabilites. is_permitted_by_s2member() Conditional to determine if a specific Category, Tag, Post, Page, URL or URI is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_post_permitted_by_s2member() Conditional to determine if a specific Post or Custom Post Type is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_post_protected_by_s2member() Conditional to determine if a specific Post ( or Custom Post Type ) is protected by s2Member; without considering the current User's Role/Capabilites. is_protected_by_s2member() Conditional to determine if a specific Category, Tag, Post, Page, URL or URI is protected by s2Member; without considering the current User's Role/Capabilites. is_tag_permitted_by_s2member() Conditional to determine if a specific Tag is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_tag_protected_by_s2member() Conditional to determine if a specific Tag is protected by s2Member; without considering the current User's Role/Capabilites. is_uri_permitted_by_s2member() Conditional to determine if a specific URI or URL is permitted by s2Member, with consideration given to the current User's Role/Capabilites. is_uri_protected_by_s2member() Conditional to determine if a specific URI or URL is protected by s2Member; without considering the current User's Role/Capabilites. is_user_not_logged_in() Conditional to determine if the current User is NOT logged in. s2member_file_download_key() Generates a File Download Key that provides access to a File protected by s2Member. s2member_paid_registration_time() Retrieves a Paid Registration Time for the current User, and/or for a particular User. s2member_pro_authnet_s2p_v_query_ok() Verifies s2p-v in a given query string argument; from a custom URL for success. s2member_pro_login_widget() Allows for the inclusion of the Pro Login Widget directly into a theme/plugin file. s2member_pro_paypal_s2p_v_query_ok() Verifies s2p-v in a given query string argument; from a custom URL for success. s2member_registration_time() Obtains the Registration Time for the current User, and/or for a particular User. user_cannot() Conditional to determine if a specific User does NOT have a specific Capability or Role. user_is() Conditional to determine if a specific User is/has a specific Role. user_is_not() Conditional to determine if a specific User is/does NOT have a specific Role. Easy API Functions for site owners to use in their own projects. These are PHP Functions designed specifically for site owners and developers. They make it easy to integrate s2Member with themes and other plugins. Everything from permissions, to details about each User; and even utility functions, are all included in this package. We recommend using these s2Member\API_Functions, s2Member\API_Constants, or Hooks/Filters ( over 1000 spread throughout all packages ) to complete an advanced integration with s2Member. Please try to refrain from using other internal classes/methods/constants whenever possible; as those are subject to change from one release to the next. Conversely, the availability of API Functions, API Constants, and Hooks/Filters will remain from one version to another. Only in rare circumstances would we ever remove one of these key elements; and if we do, backward compatibility would always remain when the previous version is deprecated for whatever reason. Many of these API Functions are designed to supplement existing core functionality that comes with WordPress®. For instance, these WordPress® functions are also very useful, and notes to this effect are spread throughout the documentation here. is_user_logged_in() current_user_can() current_user_can_for_blog() get_user_option() update_user_option() wp_get_current_user() get_users() several other conditionals ... and many others See Also: s2Member\API_Constants 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. ?php add_action ( "hook_name" , "my_action_hook_function" ) ; function my_action_hook_function( $vars = array ( ) ) { echo 'My Hook works.' ; # Optional. s2Member passes you an array of defined variables. # print_r($vars); # Would give you a list of defined variables. # These are PHP variables defined within the scope of the Hook, # at the precise point in which the Hook is fired by s2Member. # $vars["__refs"] are also included ( with some Hooks ). # These are internal PHP variable references ( very useful ). # To learn all about references, please see PHP documentation: # http://www.php.net/manual/en/language.r ... s.pass.php } ? 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. ?php add_filter ( "filter_name" , "my_filtering_function" ) ; function my_filtering_function( $original_value , $vars = array ( ) ) { if ( $original_value !== "something I like" ) return ( $my_custom_value = 'My Filter works.' ) ; else # Return original value. return $original_value ; # Optional. s2Member passes you an array of defined variables. # print_r($vars); # Would give you a list of defined variables. # These are PHP variables defined within the scope of the Filter, # at the precise point in which the Filter is fired by s2Member. # $vars["__refs"] are also included ( with some Filters ). # These are internal PHP variable references ( very useful ). # To learn all about references, please see PHP documentation: # http://www.php.net/manual/en/language.r ... s.pass.php } ? Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Summary Functions Hooks/Filters(!-- :: s-words --)Statistics: Posted by System Robot — August 15th, 2011, 1:27 pm
]]>