Make WordPress Core

Changeset 11342


Ignore:
Timestamp:
05/15/2009 05:49:35 PM (15 years ago)
Author:
ryan
Message:

Add option to wp_die to display a go back link. Props nbachiyski. fixes #5167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r11340 r11342  
    23582358    $defaults = array( 'response' => 500 );
    23592359    $r = wp_parse_args($args, $defaults);
     2360   
     2361    $have_gettext = function_exists('__');
    23602362
    23612363    if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
     
    23802382        $message = "<p>$message</p>";
    23812383    }
    2382 
     2384   
     2385    if ( isset( $r['back_link'] ) && $r['back_link'] ) {
     2386        $back_text = $have_gettext? __('&laquo; Back') : '&laquo; Back';
     2387        $message .= "\n<p><a href='javascript:history.back()'>$back_text</p>";
     2388    }
     2389   
    23832390    if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL )
    23842391        $admin_dir = WP_SITEURL . '/wp-admin/';
     
    23962403        header( 'Content-Type: text/html; charset=utf-8' );
    23972404    }
    2398 
     2405   
    23992406    if ( empty($title) ) {
    2400         if ( function_exists( '__' ) )
    2401             $title = __( 'WordPress &rsaquo; Error' );
    2402         else
    2403             $title = 'WordPress &rsaquo; Error';
     2407        $title = $have_gettext? __('WordPress &rsaquo; Error') : 'WordPress &rsaquo; Error';
    24042408    }
    24052409
Note: See TracChangeset for help on using the changeset viewer.