bbp_current_author_ip()

Get the poster IP address


Description Description


Return Return

(string)


Top ↑

Source Source

File: includes/users/functions.php

function bbp_current_author_ip() {

	// Check for remote address
	$remote_address = ! empty( $_SERVER['REMOTE_ADDR'] )
		? wp_unslash( $_SERVER['REMOTE_ADDR'] )
		: '127.0.0.1';

	// Remove any unsavory bits
	$retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $remote_address );

	// Filter & return
	return apply_filters( 'bbp_current_author_ip', $retval, $remote_address );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 bbPress (r5609) Added empty() check for unit tests
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.