• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「テンプレートタグ/the shortlink」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Template Tags/the shortlink 20:15, 19 March 2010 Miqrogroove 版を翻訳用にコピー)
 
(リンク調整、テンプレートガイド等挿入/未翻訳)
1行目: 1行目:
 +
{{NeedTrans}}
 +
{{テンプレートタグガイド|PHP}}<!-- 試験的に挿入 -->
 
== Description ==
 
== Description ==
  
Used on single post [[Glossary#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.
+
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'); ?> %%%
+
<?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 style="border:1px solid blue; width:50%; padding:10px">[http://blog.example.com/?p=1234 The is the short link.]</div>
+
<div class="example">[http://blog.example.com/?p=1234 The is the short link.]</div>
 
   
 
   
%%% <?php the_shortlink(); ?> %%%
+
<?php the_shortlink(); ?>
  
 
===Custom Text===
 
===Custom Text===
 
Displays link with the specified text.
 
Displays link with the specified text.
  
<div style="border:1px solid blue; width:50%; padding:10px">[http://blog.example.com/?p=1234 Shortlinkage FTW]</div>
+
<div class="example">[http://blog.example.com/?p=1234 Shortlinkage FTW]</div>
  
%%% <?php the_shortlink(__('Shortlinkage FTW')); ?> %%%
+
<?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 style="border:1px solid blue; width:50%; padding:10px"><ul><li>[http://blog.example.com/?p=1234 short link]</li></ul></div>
+
<div class="example"><ul><li>[http://blog.example.com/?p=1234 short link]</li></ul></div>
  
%%% <?php the_shortlink('short link', null, '<ul><li>', '</li></ul>'); ?> %%%
+
<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 {{Trac|wp-includes/link-template.php}}.
+
<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:Template Tags]]
+
{{DEFAULTSORT:The_shortlink}}
 +
[[Category:テンプレートタグ]]
 +
[[Category:wp3.0]]
  
[[en:Template Tags/the shortlink]]
+
[[en:Template Tags/the_shortlink]]

2010年3月20日 (土) 21:16時点における版

このページ「テンプレートタグ/the shortlink」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

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

最新英語版: WordPress Codex » Template Tags/the_shortlink最新版との差分