- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「テンプレートタグ/home url」の版間の差分
提供: WordPress Codex 日本語版
< テンプレートタグ
細 (日本語版向けに調整/要翻訳) |
(和訳) |
||
1行目: | 1行目: | ||
− | {{ | + | {{CheckTrans}} |
{{テンプレートタグガイド|PHP}} | {{テンプレートタグガイド|PHP}} | ||
− | == Description == | + | == 説明 == |
+ | <!-- == Description == --> | ||
− | The '''home_url''' template tag retrieves the home url for the current site. Returns the 'home' [[Option Reference|option]] with the appropriate protocol, 'https' if [[関数リファレンス/is_ssl|is_ssl()]]/[[:en:Function Reference/is_ssl|en]] and 'http' otherwise. If [[#Parameters|scheme]] is 'http' or 'https', is_ssl() is overridden. | + | '''home_url''' テンプレートタグは、現在のブログのホームURLを返します。戻り値には 'home' [[Option Reference|オプション]] と適切なプロトコルが含まれます。 [[関数リファレンス/is_ssl|is_ssl()]]/[[:en:Function Reference/is_ssl|en]] が有効な場合は 'https'、それ以外の場合は 'http' です。[[#Parameters|scheme]] で 'http' か 'https' を指定すると、is_ssl() は無効になります。 |
+ | <!-- The '''home_url''' template tag retrieves the home url for the current site. Returns the 'home' [[Option Reference|option]] with the appropriate protocol, 'https' if [[関数リファレンス/is_ssl|is_ssl()]]/[[:en:Function Reference/is_ssl|en]] and 'http' otherwise. If [[#Parameters|scheme]] is 'http' or 'https', is_ssl() is overridden. --> | ||
− | Use the [[テンプレートタグ/get_home_url|get_home_url]] tag to retrieve the url of the site specified. | + | 任意のブログのホームURLを取得するには [[テンプレートタグ/get_home_url|get_home_url]] テンプレートタグを使います。 |
+ | <!-- Use the [[テンプレートタグ/get_home_url|get_home_url]] tag to retrieve the url of the site specified. --> | ||
− | == Usage == | + | == 使い方 == |
+ | <!-- == Usage == --> | ||
<?php home_url( 'path', 'scheme' ); ?> | <?php home_url( 'path', 'scheme' ); ?> | ||
− | === Default Usage === | + | === デフォルトの使い方 === |
+ | <!-- === Default Usage === --> | ||
<?php home_url(); ?> | <?php home_url(); ?> | ||
− | == Parameters <span id="Parameters"></span>== | + | == 引数<span id="Parameters"></span> == |
+ | <!-- == Parameters <span id="Parameters"></span>== --> | ||
+ | {{Parameter|path|string|ホームURLからの相対パス。|省略可}} | ||
+ | {{Parameter|scheme|string|URLスキーム。現在利用できるのは 'http' と 'https'。|省略可|null}} | ||
+ | <!-- | ||
{{Parameter|path|string|Path relative to the home url.|optional}} | {{Parameter|path|string|Path relative to the home url.|optional}} | ||
{{Parameter|scheme|string|Scheme to give the home url context. Currently 'http','https'.|optional|null}} | {{Parameter|scheme|string|Scheme to give the home url context. Currently 'http','https'.|optional|null}} | ||
+ | --> | ||
− | == Return == | + | == 戻り値 == |
+ | <!-- == Return == --> | ||
− | (''string'') Home url link with optional path appended. | + | (''string'') ホームURL(引数 path を指定した場合は、そのパスを含むURL)へのリンク。 |
+ | <!-- (''string'') Home url link with optional path appended. --> | ||
− | == Examples == | + | == 用例 == |
+ | <!-- == Examples == --> | ||
− | == Changelog == | + | == 変更履歴 == |
+ | <!-- == Changelog == --> | ||
+ | * [[Version 3.0|3.0.0]] : テンプレートタグとして新規追加。 | ||
+ | <!-- | ||
* [[Version 3.0|3.0.0]] : New template tag. | * [[Version 3.0|3.0.0]] : New template tag. | ||
+ | --> | ||
− | == Source Code == | + | == ソースコード == |
+ | <!-- == Source Code == --> | ||
− | <code>home_url()</code> is located in {{Source|wp-includes/link-template.php}} | + | <code>home_url()</code> は、located in {{Source|wp-includes/link-template.php}} にあります。 |
+ | <!-- <code>home_url()</code> is located in {{Source|wp-includes/link-template.php}} --> | ||
{{Stub}} | {{Stub}} | ||
39行目: | 58行目: | ||
{{原文|Function Reference/home url|91053}}<!-- 14:05, 5 July 2010 Bono 版 --> | {{原文|Function Reference/home url|91053}}<!-- 14:05, 5 July 2010 Bono 版 --> | ||
− | == Related == | + | == 関連項目 == |
+ | <!-- == Related == --> | ||
{{Link Tags}} | {{Link Tags}} |
2010年7月7日 (水) 00:08時点における版
この項目「テンプレートタグ/home url」は、翻訳チェック待ちの項目です。加筆、訂正などを通して、Codex ドキュメンテーションにご協力下さい。
タグ一覧: テンプレートタグ | インクルードタグ | 条件分岐タグ | その他の関数 | Code Reference
使い方: テンプレートタグ入門 | パラメータの渡し方 | 初心者の方へ | その他のテーマ関連資料
説明
home_url テンプレートタグは、現在のブログのホームURLを返します。戻り値には 'home' オプション と適切なプロトコルが含まれます。 is_ssl()/en が有効な場合は 'https'、それ以外の場合は 'http' です。scheme で 'http' か 'https' を指定すると、is_ssl() は無効になります。
任意のブログのホームURLを取得するには get_home_url テンプレートタグを使います。
使い方
<?php home_url( 'path', 'scheme' ); ?>
デフォルトの使い方
<?php home_url(); ?>
引数
- path
- (string) (省略可) ホームURLからの相対パス。
- 初期値: なし
- scheme
- (string) (省略可) URLスキーム。現在利用できるのは 'http' と 'https'。
- 初期値: null
戻り値
(string) ホームURL(引数 path を指定した場合は、そのパスを含むURL)へのリンク。
用例
変更履歴
- 3.0.0 : テンプレートタグとして新規追加。
ソースコード
home_url()
は、located in wp-includes/link-template.php
にあります。
最新英語版: WordPress Codex » Function Reference/home url (最新版との差分)
関連項目
関数リファレンス、テンプレートタグ目次もご覧ください。