Loads Akismet extension

since 2.0.0 bbPress (r3277)
package bbPress
subpackage Akismet

 Methods

The main bbPress Akismet loader

__construct() 
since 2.0.0 bbPress (r3277)

Add Aksimet History meta-boxes to topics and replies

add_metaboxes() 
since 2.4.0 bbPress (r5049)

Converts topic/reply data into Akismet comment checking format

check_post(string $post_data) : array
since 2.0.0 bbPress (r3277)

Parameters

$post_data

string

Returns

arrayArray of post data

Handle any terms submitted with a post flagged as spam

filter_post_terms(string $terms = '', integer $topic_id = 0, integer $reply_id = 0) : array
since 2.0.0 bbPress (r3308)

Parameters

$terms

string

Comma-separated list of terms

$topic_id

integer

$reply_id

integer

Returns

arrayArray of existing topic terms

Get the Akismet history of a Post

get_post_history(integer $post_id = 0) : array
since 2.0.0 bbPress (r3308)

Parameters

$post_id

integer

Returns

arrayArray of Akismet history

Output for Akismet History meta-box

history_metabox() 
since 2.4.0 bbPress (r5049)

Submit a post for spamming or hamming

submit_post(integer $post_id = 0) : array
since 2.0.0 bbPress (r3277)
global string $akismet_api_host
global string $akismet_api_port
global object $current_user
global object $current_site

Parameters

$post_id

integer

Returns

arrayArray of existing topic terms

Return a user's roles on this site (including super_admin)

get_user_roles(integer $user_id = 0) : boolean
since 2.3.0 bbPress (r4812)

Parameters

$user_id

integer

Returns

boolean

Submit data to Akismet service with unique bbPress User Agent

http_post(string $request, string $host, string $path, string $port = 80, string $ip = '') : mixed

This code is directly taken from the akismet_http_post() function and documented to bbPress 2.0 standard.

since 2.0.0 bbPress (r3466)

Parameters

$request

string

The request we are sending

$host

string

The host to send our request to

$path

string

The path from the host

$port

string

The port to use

$ip

string

Optional Override $host with an IP address

Returns

mixedWP_Error on error, array on success, empty on failure

Ping Akismet service and check for spam/ham response

maybe_spam(array $post_data, string $check = 'check', string $spam = 'spam') : array
since 2.0.0 bbPress (r3277)
global string $akismet_api_host
global string $akismet_api_port

Parameters

$post_data

array

$check

string

Accepts check|submit

$spam

string

Accepts spam|ham

Returns

arrayArray of post data

Parse the response from the Akismet service, and alter the post data as necessary. For example, switch the status to `spam` if spammy.

parse_response(array $post_data = array()) : array

Note: this method also skiis responsible for allowing users who can moderate, to never have their posts marked as spam. This is because they are "trusted" users. However, their posts are still sent to Akismet to be checked.

since 2.6.0 bbPress (r6873)

Parameters

$post_data

array

Returns

array

Setup the admin hooks

setup_actions() 
since 2.0.0 bbPress (r3277)
access private

Update Akismet history of a Post

update_post_history(integer $post_id = 0, string $message = null, string $event = null
since 2.0.0 bbPress (r3308)

Parameters

$post_id

integer

$message

string

$event

string