wp_maybe_disable_xmlrpc_pingback_for_environment( string[] $methods ): string[]

In this article

Removes the pingback XML-RPC method in non-production environments.

Parameters

$methodsstring[]required
An array of XML-RPC methods, keyed by their methodName.

Return

string[] Modified array of XML-RPC methods.

Source

function wp_maybe_disable_xmlrpc_pingback_for_environment( $methods ) {
	if ( wp_should_disable_pings_for_environment() ) {
		unset( $methods['pingback.ping'] );
	}

	return $methods;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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