wp_maybe_disable_xmlrpc_pingback_for_environment()WP 7.1.0

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

No Hooks.

Returns

string[]. Modified array of XML-RPC methods.

Usage

wp_maybe_disable_xmlrpc_pingback_for_environment( $methods );
$methods(string[]) (required)
An array of XML-RPC methods, keyed by their methodName.

Changelog

Since 7.1.0 Introduced.

wp_maybe_disable_xmlrpc_pingback_for_environment() code WP 7.1

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

	return $methods;
}