- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「テンプレートタグ/the shortlink」の版間の差分
(en:Template Tags/the shortlink 20:15, 19 March 2010 Miqrogroove 版を翻訳用にコピー) |
細 (リンク調整、テンプレートガイド等挿入/未翻訳) |
||
1行目: | 1行目: | ||
+ | {{NeedTrans}} | ||
+ | {{テンプレートタグガイド|PHP}}<!-- 試験的に挿入 --> | ||
== Description == | == Description == | ||
− | Used on single post [[ | + | Used on single post [[用語集#Permalink|permalink]] pages, this template tag displays a "URL shortening" link for the current post. By default, this will mean the URL has a format of /?p=1234, and will only appear if pretty permalinks are enabled. However, this feature is limited by design and intended to be leveraged by plugins that may offer links in a different format, a custom format, or even a format provided by a third-party URL shortening service. |
This tag must be used in [[The Loop]]. | This tag must be used in [[The Loop]]. | ||
7行目: | 9行目: | ||
== Usage == | == Usage == | ||
− | + | <?php the_shortlink('text', 'title', 'before', 'after'); ?> | |
== Examples == | == Examples == | ||
14行目: | 16行目: | ||
Displays link with "The is the short link." as the text. | Displays link with "The is the short link." as the text. | ||
− | <div | + | <div class="example">[http://blog.example.com/?p=1234 The is the short link.]</div> |
− | + | <?php the_shortlink(); ?> | |
===Custom Text=== | ===Custom Text=== | ||
Displays link with the specified text. | Displays link with the specified text. | ||
− | <div | + | <div class="example">[http://blog.example.com/?p=1234 Shortlinkage FTW]</div> |
− | + | <?php the_shortlink(__('Shortlinkage FTW')); ?> | |
===Conditional HTML=== | ===Conditional HTML=== | ||
Displays link with prefix and suffix HTML that will appear only when the shortlink URL is available. | Displays link with prefix and suffix HTML that will appear only when the shortlink URL is available. | ||
− | <div | + | <div class="example"><ul><li>[http://blog.example.com/?p=1234 short link]</li></ul></div> |
− | + | <pre><?php the_shortlink('short link', null, '<ul><li>', '</li></ul>'); ?></pre> | |
== Parameters == | == Parameters == | ||
40行目: | 42行目: | ||
==Source File== | ==Source File== | ||
− | <tt>the_permalink()</tt> is located in {{ | + | <tt>the_permalink()</tt> is located in {{Source|wp-includes/link-template.php|3.0}}. |
== Change Log == | == Change Log == | ||
− | * Since: 3.0.0 | + | * Since: [[Version 3.0|3.0.0]] |
{{原文|Template Tags/the_shortlink|84451}}<!-- 20:15, 19 March 2010 Miqrogroove 版 --> | {{原文|Template Tags/the_shortlink|84451}}<!-- 20:15, 19 March 2010 Miqrogroove 版 --> | ||
− | [[Category: | + | {{DEFAULTSORT:The_shortlink}} |
+ | [[Category:テンプレートタグ]] | ||
+ | [[Category:wp3.0]] | ||
− | [[en:Template Tags/ | + | [[en:Template Tags/the_shortlink]] |
2010年3月20日 (土) 21:16時点における版
このページ「テンプレートタグ/the shortlink」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
タグ一覧: テンプレートタグ | インクルードタグ | 条件分岐タグ | その他の関数 | Code Reference
使い方: テンプレートタグ入門 | パラメータの渡し方 | 初心者の方へ | その他のテーマ関連資料
目次
Description
Used on single post permalink pages, this template tag displays a "URL shortening" link for the current post. By default, this will mean the URL has a format of /?p=1234, and will only appear if pretty permalinks are enabled. However, this feature is limited by design and intended to be leveraged by plugins that may offer links in a different format, a custom format, or even a format provided by a third-party URL shortening service.
This tag must be used in The Loop.
Usage
<?php the_shortlink('text', 'title', 'before', 'after'); ?>
Examples
Default Usage
Displays link with "The is the short link." as the text.
<?php the_shortlink(); ?>
Custom Text
Displays link with the specified text.
<?php the_shortlink(__('Shortlinkage FTW')); ?>
Conditional HTML
Displays link with prefix and suffix HTML that will appear only when the shortlink URL is available.
<?php the_shortlink('short link', null, '<ul><li>', '</li></ul>'); ?>
Parameters
- text
- (string) Link text to display. Defaults to "This is the short link."
- title
- (string) Tool-tip text displayed with the link. Defaults to the post title.
- before
- (string) Text or HTML prefix added to the link.
- after
- (string) Text or HTML suffix added to the link.
Source File
the_permalink() is located in wp-includes/link-template.php
.
Change Log
- Since: 3.0.0
最新英語版: WordPress Codex » Template Tags/the_shortlink (最新版との差分)