WordPress.org

Make WordPress Core

Ticket #21472: 21472.diff

File 21472.diff, 764 bytes (added by iamfriendly, 6 years ago)

Refreshed the patch and added docs

  • wp-includes/functions.php

    diff --git wp-includes/functions.php wp-includes/functions.php
    index 1e273b2..a613b09 100644
    function get_status_header_desc( $code ) { 
    985985 * @see get_status_header_desc()
    986986 *
    987987 * @param int $code HTTP status code.
     988 * @param string $description The description for the HTTP status.
    988989 */
    989 function status_header( $code ) {
    990         $description = get_status_header_desc( $code );
     990function status_header( $code, $description = null ) {
     991        if ( ! $description ) {
     992                $description = get_status_header_desc( $code );
     993        }
    991994
    992         if ( empty( $description ) )
     995        if ( empty( $description ) ) {
    993996                return;
     997        }
    994998
    995999        $protocol = wp_get_server_protocol();
    9961000        $status_header = "$protocol $code $description";