Make WordPress Core

Ticket #21472: 21472.2.diff

File 21472.2.diff, 941 bytes (added by johnbillion, 9 years ago)
  • src/wp-includes/functions.php

     
    981981 * Set HTTP status header.
    982982 *
    983983 * @since 2.0.0
     984 * @since 4.4.0 Added the `$description` parameter.
    984985 *
    985986 * @see get_status_header_desc()
    986987 *
    987  * @param int $code HTTP status code.
     988 * @param int    $code        HTTP status code.
     989 * @param string $description Optional. A custom description for the HTTP status.
    988990 */
    989 function status_header( $code ) {
    990         $description = get_status_header_desc( $code );
     991function status_header( $code, $description = '' ) {
     992        if ( ! $description ) {
     993                $description = get_status_header_desc( $code );
     994        }
    991995
    992         if ( empty( $description ) )
     996        if ( empty( $description ) ) {
    993997                return;
     998        }
    994999
    9951000        $protocol = wp_get_server_protocol();
    9961001        $status_header = "$protocol $code $description";