PHP Класс Jetpack_Subscriptions, jetpack

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$hash
$jetpack

Открытые методы

Метод Описание
__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()

Описание методов

__construct() публичный Метод

public __construct ( )

comment_subscribe_init() публичный Метод

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

comment_subscribe_submit() публичный Метод

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() публичный Метод

Jetpack Subscriptions configuration screen.
public configure ( )

get_default_settings() публичный Метод

get_settings() публичный Метод

public get_settings ( )

init() статический публичный Метод

Singleton
static public init ( )

maybe_send_subscription_email() публичный Метод

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 reading_section ( )

set_cookies() публичный Метод

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 set_post_flags ( $flags, $post )

setting_comment_follow() публичный Метод

setting_invitation() публичный Метод

public setting_invitation ( )

should_email_post_to_subscribers() публичный Метод

subscribe() публичный Метод

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.
Результат 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() публичный Метод

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() публичный Метод

public validate_settings ( $settings )

widget_init() публичный Метод

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

widget_submit() публичный Метод

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

xmlrpc_methods() публичный Метод

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

Описание свойств

$hash публичное статическое свойство

public static $hash

$jetpack публичное свойство

public $jetpack