- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/site url
提供: WordPress Codex 日本語版
< テンプレートタグ
2010年4月14日 (水) 00:34時点におけるBono (トーク | 投稿記録)による版 (en:Template Tags/site_url 14:42, 13 April 2010 Bono 版を翻訳用にコピー)
目次
Description
The site_url() template tag retrieve the site url for the current site. Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden.
Use get_site_url() to get the url of the site specified.
Usage
%%%<?php site_url('path', 'scheme'); ?>%%%
Default Usage
%%%<?php site_url(); ?>%%%
Parameters
- path
- (string) (optional) Path relative to the site url.
- 初期値: なし
- scheme
- (string) (optional) Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'.
- 初期値: null
Return
Site url link with optional path appended. (string)
Examples
Changelog
- 2.6.0 : New template tag.
Source Code
site_url()
is located in wp-includes/link-template.php
.
最新英語版: WordPress Codex » Template Tags/site_url (最新版との差分)
Related
関数リファレンス、テンプレートタグ目次もご覧ください。