\Highlander_Comments_Base

All the code shared between WP.com Highlander and Jetpack Highlander

Summary

Methods
Properties
Constants
__construct()
is_highlander_comment_post()
sign_remote_comment_parameters()
comments_array()
sort_comments_by_comment_date_gmt()
allow_logged_out_user_to_comment_as_external()
allow_logged_in_user_to_comment_as_guest()
set_comment_cookies()
No public properties found
No constants found
setup_globals()
setup_actions()
setup_filters()
get_current_commenter()
photon_avatar()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct()

is_highlander_comment_post()

is_highlander_comment_post() : false|string

Is this a Highlander POST request? Optionally restrict to one or more credentials slug (facebook, twitter, .

..)

Returns

false|string —

false if it's not a Highlander POST request. The matching credentials slug if it is.

sign_remote_comment_parameters()

sign_remote_comment_parameters(array $parameters, string $key) : string

Signs an array of scalars with the self-hosted blog's Jetpack Token

Parameters

array $parameters
string $key

Returns

string —

HMAC

comments_array()

comments_array( $comments)

Parameters

$comments

sort_comments_by_comment_date_gmt()

sort_comments_by_comment_date_gmt(object $a, object $b) : int

Comment sort comparator: comment_date_gmt

Parameters

object $a
object $b

Returns

int

allow_logged_out_user_to_comment_as_external()

allow_logged_out_user_to_comment_as_external() : \If

Allows a logged out user to leave a comment as a facebook or twitter credentialed user.

Overrides WordPress' core comment_registration option to treat these commenters as "registered" (verified) users.

Returns

\If —

no

allow_logged_in_user_to_comment_as_guest()

allow_logged_in_user_to_comment_as_guest(array $comment_data) : int

Allow a logged in user to post as a guest, FB, or twitter credentialed request.

Bypasses WordPress' core overrides that force a logged in user to comment as that user. Respects comment_registration option.

Parameters

array $comment_data

Returns

int

set_comment_cookies()

set_comment_cookies(\type $comment_id) : \If

Set the comment cookies or bail if comment is invalid

Parameters

\type $comment_id

Returns

\If —

comment is invalid

setup_globals()

setup_globals()

Set any global variables or class variables

setup_actions()

setup_actions()

Setup actions for methods in this class

setup_filters()

setup_filters()

Setup filters for methods in this class

get_current_commenter()

get_current_commenter() : array

Get the current commenter's information from their cookie

Returns

array —

Commenters information from cookie

photon_avatar()

photon_avatar(string $url, int $size) : string

Get an avatar from Photon

Parameters

string $url
int $size

Returns

string