Warning: This function has been deprecated. Use wp_die() instead.

graceful_fail() WordPress Function

The graceful_fail() function is used to gracefully fail a request by returning a special status code. This function is useful for cases where a user may be trying to access a resource that does not exist or is not accessible. By returning a special status code, the user is notified that the request has failed but can still take appropriate action.

graceful_fail( $message ) #

Deprecated functionality to gracefully fail.


Description

Top ↑

See also


Top ↑

Source

File: wp-includes/ms-deprecated.php

function graceful_fail( $message ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );
	$message = apply_filters( 'graceful_fail', $message );
	$message_template = apply_filters( 'graceful_fail_template',
'<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Error!</title>
<style type="text/css">
img {
	border: 0;
}
body {
line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
text-align: center;
}
.message {
	font-size: 22px;
	width: 350px;
	margin: auto;
}
</style>
</head>
<body>
<p class="message">%s</p>
</body>
</html>' );
	die( sprintf( $message_template, $message ) );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Use wp_die()
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.