説明
string get_status_header_desc( int $code )
HTTPステータス説明文を取得する。
パラメータ
- $codeHTTPステータスコード。
返り値
パラメータ$codeに応じたHTTPステータス説明文を返す。未知のステータスコードを指定した場合は''を返す。注意
主なステータスコードと説明文は次の通り。コード | 説明文 | バージョン |
---|---|---|
100 | Continue | 2.3.0~ |
101 | Switching Protocols | 2.3.0~ |
102 | Processing | 2.3.0~ |
103 | Early Hints | 5.1.0~ |
200 | OK | 2.3.0~ |
201 | Created | 2.3.0~ |
202 | Accepted | 2.3.0~ |
203 | Non-Authoritative Information | 2.3.0~ |
204 | No Content | 2.3.0~ |
205 | Reset Content | 2.3.0~ |
206 | Partial Content | 2.3.0~ |
207 | Multi-Status | 2.3.0~ |
226 | IM Used | 2.3.0~ |
300 | Multiple Choices | 2.3.0~ |
301 | Moved Permanently | 2.3.0~ |
302 | Found | 2.3.0~ |
303 | See Other | 2.3.0~ |
304 | Not Modified | 2.3.0~ |
305 | Use Proxy | 2.3.0~ |
306 | Reserved | 2.3.0~ |
307 | Temporary Redirect | 2.3.0~ |
308 | Permanent Redirect | 4.5.0~ |
400 | Bad Request | 2.3.0~ |
401 | Unauthorized | 2.3.0~ |
402 | Payment Required | 2.3.0~ |
403 | Forbidden | 2.3.0~ |
404 | Not Found | 2.3.0~ |
405 | Method Not Allowed | 2.3.0~ |
406 | Not Acceptable | 2.3.0~ |
407 | Proxy Authentication Required | 2.3.0~ |
408 | Request Timeout | 2.3.0~ |
409 | Conflict | 2.3.0~ |
410 | Gone | 2.3.0~ |
411 | Length Required | 2.3.0~ |
412 | Precondition Failed | 2.3.0~ |
413 | Request Entity Too Large | 2.3.0~ |
414 | Request-URI Too Long | 2.3.0~ |
415 | Unsupported Media Type | 2.3.0~ |
416 | Requested Range Not Satisfiable | 2.3.0~ |
417 | Expectation Failed | 2.3.0~ |
418 | I'm a teapot | 3.9.0~ |
421 | Misdirected Request | 4.5.0~ |
422 | Unprocessable Entity | 2.3.0~ |
423 | Locked | 2.3.0~ |
424 | Failed Dependency | 2.3.0~ |
426 | Upgrade Required | 2.3.0~ |
428 | Precondition Required | 3.9.0~ |
429 | Too Many Requests | 3.9.0~ |
431 | Request Header Fields Too Large | 3.9.0~ |
451 | Unavailable For Legal Reasons | 4.5.0~ |
500 | Internal Server Error | 2.3.0~ |
501 | Not Implemented | 2.3.0~ |
502 | Bad Gateway | 2.3.0~ |
503 | Service Unavailable | 2.3.0~ |
504 | Gateway Timeout | 2.3.0~ |
505 | HTTP Version Not Supported | 2.3.0~ |
506 | Variant Also Negotiates | 2.3.0~ |
507 | Insufficient Storage | 2.3.0~ |
510 | Not Extended | 2.3.0~ |
511 | Network Authentication Required | 3.9.0~ |
使用例
- HTTPステータスコード403の説明文を取得する。<?php $desc = get_status_header_desc( 403 ); ?>
フィルター
実行するフィルターはありません。アクション
実行するアクションはありません。ソースファイル
/wp-includes/functions.php最終更新 : 2019年02月22日 14:23
関連
お勧め
wp_titleからwp_get_document_titleへ(2018年5月27日 更新)
先週、WordPress 4.4 beta1(以降4.4 beta1)が公開されました。この4.4 beta1では新テーマ「Twenty Sixteen」が追加されたほか、wp-includesディレクトリ以下のファイルが大幅に変更された感じです。
ツイート引用が簡単になる仕組み(2012年6月8日 更新)
WordPress 3.4では、投稿記事の中にツイートのURLを記述するだけで、投稿ページにそれっぽい表示をしてくれるようになる。ちょっと気になったので、その仕組みを追っかけてみた。5.5の機能強化:テーマ変更時に要求バージョンを確認(2020年8月12日 更新)
WordPress 5.5 RC 2が公開され、来週には正式版がリリース。変更箇所が多い「WordPress 5.5 RC 2(以降RC 2)」のソースコードを眺めていると、テーマの切り替え前にWordPressとPHPのバージョンを確認するようになっていた。
サイトヘルス機能を使ってみた(2019年4月12日 更新)
先月末にWordPress 5.2 Beta1が、今日はWordPress 5.2 Beta2(以降5.2Beta2)が公開された。5.2ではブロックエディターの機能が強化され、サイトの安全性とパフォーマンス向上に役立つとされるサイトヘルス機能が追加される。
ブロックエディターで編集したページが出力した余分な改行を削除(2019年2月22日 更新)
ブロックエディターで編集したページのHTMLソースは、投稿本文部分の改行が目立った。Webページとしての表示は問題ないのだが、データとしては不要なので削除することにした。