Filter hook 'akismet_ua'

in WP Core File wp-content/plugins/akismet/class.akismet.php at line 1427

View Source

akismet_ua

Filter Hook
Description
Make a POST request to the Akismet API.

Hook Information

File Location wp-content/plugins/akismet/class.akismet.php View on GitHub
Hook Type Filter
Line Number 1427

Hook Parameters

Type Name Description
string $request The body of the request.
string $path The path for the request.
string $ip The specific IP address to hit.

Usage Examples

Basic Usage
<?php
// Hook into akismet_ua
add_filter('akismet_ua', 'my_custom_filter', 10, 3);

function my_custom_filter($request, $path, $ip) {
    // Your custom filtering logic here
    return $request;
}

Source Code Context

wp-content/plugins/akismet/class.akismet.php:1427 - How this hook is used in WordPress core
<?php
1422  	 * @return array A two-member array consisting of the headers and the response body, both empty in the case of a failure.
1423  	 */
1424  	public static function http_post( $request, $path, $ip = null ) {
1425  
1426  		$akismet_ua = sprintf( 'WordPress/%s | Akismet/%s', $GLOBALS['wp_version'], constant( 'AKISMET_VERSION' ) );
1427  		$akismet_ua = apply_filters( 'akismet_ua', $akismet_ua );
1428  
1429  		$host    = self::API_HOST;
1430  		$api_key = self::get_api_key();
1431  
1432  		if ( $api_key ) {

PHP Documentation

<?php
/**
	 * Make a POST request to the Akismet API.
	 *
	 * @param string $request The body of the request.
	 * @param string $path The path for the request.
	 * @param string $ip The specific IP address to hit.
	 * @return array A two-member array consisting of the headers and the response body, both empty in the case of a failure.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-content/plugins/akismet/class.akismet.php
Related Hooks

Related hooks will be displayed here in future updates.