wp_maybe_disable_trackback_for_environment()

In this article

Rejects incoming trackbacks in non-production environments.

Description

Hooked to pre_trackback_post which fires in wp-trackback.php before the trackback is processed. Calls trackback_response() which sends an XML error response and terminates the request.

Source

function wp_maybe_disable_trackback_for_environment() {
	if ( wp_should_disable_pings_for_environment() ) {
		trackback_response( 1, __( 'Trackbacks are disabled in non-production environments.' ) );
	}
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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