mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
Allow wp_die() to die in plain text when running the test suite.
Props jorbin. Fixes #27749. git-svn-id: https://develop.svn.wordpress.org/trunk@28797 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -70,4 +70,36 @@ class Basic_Object {
|
||||
}
|
||||
}
|
||||
|
||||
class Basic_Subclass extends Basic_Object {}
|
||||
class Basic_Subclass extends Basic_Object {}
|
||||
|
||||
function _wp_die_handler( $message, $title = '', $args = array() ) {
|
||||
if ( !$GLOBALS['_wp_die_disabled'] ) {
|
||||
_wp_die_handler_txt( $message, $title, $args);
|
||||
} else {
|
||||
//Ignore at our peril
|
||||
}
|
||||
}
|
||||
|
||||
function _disable_wp_die() {
|
||||
$GLOBALS['_wp_die_disabled'] = true;
|
||||
}
|
||||
|
||||
function _enable_wp_die() {
|
||||
$GLOBALS['_wp_die_disabled'] = false;
|
||||
}
|
||||
|
||||
function _wp_die_handler_filter() {
|
||||
return '_wp_die_handler';
|
||||
}
|
||||
|
||||
function _wp_die_handler_txt( $message, $title, $args ) {
|
||||
echo "\nwp_die called\n";
|
||||
echo "Message : $message\n";
|
||||
echo "Title : $title\n";
|
||||
if ( ! empty( $args ) ) {
|
||||
echo "Args: \n";
|
||||
foreach( $args as $k => $v ){
|
||||
echo "\t $k : $v\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user