Comment extends Component

Handles comments.

Table of Contents

__construct()  : mixed
Class constructor.
clear_comment_count()  : mixed
Clears comment count.
disable_notifications()  : bool
Disables email notifications.
filter_comment_activity()  : mixed
Filters comment activity.
filter_comment_feed()  : string
Filters comment RSS feed.
filter_comment_list()  : array<string|int, mixed>
Filters comment list.
filter_comment_query()  : mixed
Filters comment WP query.
filter_xmlrpc_comment()  : array<string|int, mixed>
Filters XML-RPC comment.
restrict_comment_editing()  : array<string|int, mixed>
Restricts comment editing.
restrict_comment_screen()  : mixed
Restricts comment screen.
restrict_comment_status()  : mixed
Restricts comment status.
restrict_rest_comment()  : WP_REST_Response
Restricts REST comment.
restrict_rest_comment_editing()  : mixed
Restricts REST comment editing.
update_comment_count()  : array<string|int, mixed>
Updates comment count.
boot()  : mixed
Bootstraps component properties.
get_comment_types()  : array<string|int, mixed>
Gets comment types.
set_callbacks()  : mixed
Sets the action and filter callbacks.
set_property()  : mixed
Sets a property value.

Methods

__construct()

Class constructor.

public __construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
$args : array<string|int, mixed> = []

Component arguments.

Return values
mixed —

disable_notifications()

Disables email notifications.

public disable_notifications(bool $notify, int $comment_id) : bool
Parameters
$notify : bool

Notify comment author?

$comment_id : int

Comment ID.

Return values
bool —

filter_comment_feed()

Filters comment RSS feed.

public filter_comment_feed(string $where) : string
Parameters
$where : string

Where clause.

Return values
string —

filter_comment_list()

Filters comment list.

public filter_comment_list(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Query arguments.

Return values
array<string|int, mixed> —

filter_comment_query()

Filters comment WP query.

public filter_comment_query(WP_Comment_Query $query) : mixed
Parameters
$query : WP_Comment_Query

Comment query.

Return values
mixed —

filter_xmlrpc_comment()

Filters XML-RPC comment.

public filter_xmlrpc_comment(array<string|int, mixed> $data, WP_Comment $comment) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Comment data.

$comment : WP_Comment

Comment object.

Return values
array<string|int, mixed> —

restrict_comment_editing()

Restricts comment editing.

public restrict_comment_editing(array<string|int, mixed> $caps, string $cap, int $user_id, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$caps : array<string|int, mixed>

Primitive capabilities.

$cap : string

Meta capability.

$user_id : int

User ID.

$args : array<string|int, mixed>

Capability arguments.

Return values
array<string|int, mixed> —

restrict_rest_comment()

Restricts REST comment.

public restrict_rest_comment(WP_REST_Response $response, WP_Comment $comment) : WP_REST_Response
Parameters
$response : WP_REST_Response

REST response.

$comment : WP_Comment

Comment object.

Return values
WP_REST_Response —

restrict_rest_comment_editing()

Restricts REST comment editing.

public restrict_rest_comment_editing(mixed $response, array<string|int, mixed> $handler, WP_REST_Request $request) : mixed
Parameters
$response : mixed

Response.

$handler : array<string|int, mixed>

Route handler.

$request : WP_REST_Request

REST request.

Return values
mixed —

update_comment_count()

Updates comment count.

public update_comment_count(array<string|int, mixed> $stats, int $post_id) : array<string|int, mixed>
Parameters
$stats : array<string|int, mixed>

Comment stats.

$post_id : int

Post ID.

Return values
array<string|int, mixed> —

set_callbacks()

Sets the action and filter callbacks.

protected final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
$callbacks : array<string|int, mixed>

Callback arguments.

Return values
mixed —

set_property()

Sets a property value.

protected final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
$name : string

Property name.

$value : mixed

Property value.

$prefix : string = ''

Method prefix.

Return values
mixed —