wp_get_server_protocol example


function wp_check_php_mysql_versions() {
    global $required_php_version$wp_version;

    $php_version = PHP_VERSION;

    if ( version_compare( $required_php_version$php_version, '>' ) ) {
        $protocol = wp_get_server_protocol();
        header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
        header( 'Content-Type: text/html; charset=utf-8' );
        printf(
            'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.',
            $php_version,
            $wp_version,
            $required_php_version
        );
        exit( 1 );
    }

    

function status_header( $code$description = '' ) {
    if ( ! $description ) {
        $description = get_status_header_desc( $code );
    }

    if ( empty( $description ) ) {
        return;
    }

    $protocol      = wp_get_server_protocol();
    $status_header = "$protocol $code $description";
    if ( function_exists( 'apply_filters' ) ) {

        /** * Filters an HTTP status header. * * @since 2.2.0 * * @param string $status_header HTTP status header. * @param int $code HTTP status code. * @param string $description Description for the status code. * @param string $protocol Server protocol. */
Home | Imprint | This part of the site doesn't use cookies.