PHP Class Jetpack_Subscriptions, jetpack

Datei anzeigen Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$hash
$jetpack

Public Methods

Method Description
__construct ( )
comment_subscribe_init ( ) Jetpack_Subscriptions::comment_subscribe_init()
comment_subscribe_submit ( $comment_id, $approved ) Jetpack_Subscriptions::comment_subscribe_init()
configure ( ) Jetpack_Subscriptions::configure()
get_default_settings ( )
get_settings ( )
init ( ) Singleton
maybe_send_subscription_email ( $new_status, $old_status, $post ) Checks whether or not the post should be emailed to subscribers
reading_section ( )
set_cookies ( boolean $subscribe_to_post = false, integer $post_id = null, boolean $subscribe_to_blog = false ) Jetpack_Subscriptions::set_cookies()
set_post_flags ( $flags, $post )
setting_comment_follow ( )
setting_invitation ( )
should_email_post_to_subscribers ( $post )
subscribe ( string $email, array $post_ids, boolean $async = true, $extra_data = [] ) : true | Jetpack_Error Jetpack_Subscriptions::subscribe()
subscription_comment_subscribe_setting ( ) Comments Subscriptions Toggle
subscription_post_page_metabox ( ) * Disable Subscribe on Single Post Register post meta
subscription_post_subscribe_setting ( ) Post Subscriptions Toggle
subscriptions_settings_section ( ) Discussions setting section blurb
validate_settings ( $settings )
widget_init ( ) Jetpack_Subscriptions::widget_init()
widget_submit ( ) Jetpack_Subscriptions::widget_submit()
xmlrpc_methods ( array $methods ) Jetpack_Subscriptions::xmlrpc_methods()

Method Details

__construct() public method

public __construct ( )

comment_subscribe_init() public method

Set up and add the comment subscription checkbox to the comment form.

comment_subscribe_submit() public method

When a user checks the comment subscribe box and submits a comment, subscribe them to the comment thread.
public comment_subscribe_submit ( $comment_id, $approved )

configure() public method

Jetpack Subscriptions configuration screen.
public configure ( )

get_default_settings() public method

get_settings() public method

public get_settings ( )

init() static public method

Singleton
static public init ( )

maybe_send_subscription_email() public method

It checks for the following things in order: - Usage of filter jetpack_subscriptions_exclude_these_categories - Usage of filter jetpack_subscriptions_include_only_these_categories - Existence of the per-post checkbox option Only one of these can be used at any given time.
public maybe_send_subscription_email ( $new_status, $old_status, $post )
$new_status string - the "new" post status of the transition when saved
$old_status string - the "old" post status of the transition when saved
$post obj - The post object

reading_section() public method

public reading_section ( )

set_cookies() public method

Set a cookie to save state on the comment and post subscription checkboxes.
public set_cookies ( boolean $subscribe_to_post = false, integer $post_id = null, boolean $subscribe_to_blog = false )
$subscribe_to_post boolean Whether the user chose to subscribe to subsequent comments on this post.
$post_id integer If $subscribe_to_post is true, the post ID they've subscribed to.
$subscribe_to_blog boolean Whether the user chose to subscribe to all new posts on the blog.

set_post_flags() public method

public set_post_flags ( $flags, $post )

setting_comment_follow() public method

setting_invitation() public method

public setting_invitation ( )

should_email_post_to_subscribers() public method

subscribe() public method

Send a synchronous XML-RPC subscribe to blog posts or subscribe to post comments request.
public subscribe ( string $email, array $post_ids, boolean $async = true, $extra_data = [] ) : true | Jetpack_Error
$email string
$post_ids array (optional) defaults to 0 for blog posts only: array of post IDs to subscribe to blog's posts
$async boolean (optional) Should the subscription be performed asynchronously? Defaults to true.
return true | Jetpack_Error true on success invalid_email : not a valid email address invalid_post_id : not a valid post ID unknown_post_id : unknown post not_subscribed : strange error. Jetpack servers at WordPress.com could subscribe the email. disabled : Site owner has disabled subscriptions. active : Already subscribed. unknown : strange error. Jetpack servers at WordPress.com returned something malformed. unknown_status : strange error. Jetpack servers at WordPress.com returned something I didn't understand.

subscription_comment_subscribe_setting() public method

Comments Subscriptions Toggle

subscription_post_page_metabox() public method

* Disable Subscribe on Single Post Register post meta

subscription_post_subscribe_setting() public method

Post Subscriptions Toggle

subscriptions_settings_section() public method

Discussions setting section blurb

validate_settings() public method

public validate_settings ( $settings )

widget_init() public method

Initialize and register the Jetpack Subscriptions widget.
public widget_init ( )

widget_submit() public method

When a user submits their email via the blog subscription widget, check the details and call the subsribe() method.
public widget_submit ( )

xmlrpc_methods() public method

Register subscriptions methods with the Jetpack XML-RPC server.
public xmlrpc_methods ( array $methods )
$methods array

Property Details

$hash public_oe static_oe property

public static $hash

$jetpack public_oe property

public $jetpack