get_archives_link

Sponsored Link

定義済みまたはカスタムコードに基づいて、アーカイブリンクのコンテンツを取得します。

Sponsored Link

定義済みまたはカスタムコードに基づいて、アーカイブリンクのコンテンツを取得します。

フォーマットは、4つのスタイルのいずれかです。 head要素のための’link’、select要素内で使用するための’option’、リスト内で使用するために’html’(olまたはulHTML要素のいずれか)。カスタム内容はパラメーターの前後で使用するためにサポートされています。

’link’フォーマットは、アーカイブ関係とリンクHTML要素を使用しています。前後のパラーメータでは使用されません。テキストパラメータは、リンクを記述するために使用されます。

‘option’フォーマットは、セレクト要素内で使用するためにオプションのHTML要素を使用しています。URLパラメータと前後のパラメーターはテキスト記述との間で使用される値です。

デフォルトの’html’フォーマットは、リストHTML要素内で使用するためにliHTML要素を使用します。前のパラーメータはリンクの前で、後のパラメータは閉じているリンクを後です。

カスタムフォーマットは、リンクの前の前のパラメータ(’a’HTML要素)と、閉じているリンクタグの後の後のパラメータで使用します。

形式については、上記の三つの値が使用されていない場合は、カスタム形式と見なされます。

Retrieve archive link content based on predefined or custom code.

The format can be one of four styles. The ‘link’ for head element, ‘option’ for use in the select element, ‘html’ for use in list (either ol or ul HTML elements). Custom content is also supported using the before and after parameters.

The ‘link’ format uses the link HTML element with the archives relationship. The before and after parameters are not used. The text parameter is used to describe the link.

The ‘option’ format uses the option HTML element for use in select element. The value is the url parameter and the before and after parameters are used between the text description.

The ‘html’ format, which is the default, uses the li HTML element for use in the list HTML elements. The before parameter is before the link and the after parameter is after the closing link.

The custom format uses the before parameter before the link (‘a’ HTML element) and the after parameter after the closing link tag. If the above three values for the format are not used, then custom format is assumed.

get_archives_linkのテンプレートタグ使用方法

<?php get_archives_link( $url, $text, $format, $before, $after ); ?>

get_archives_linkのパラメーター

$url

(string) (required) アーカイブURLです。
デフォルト:なし

(string) (required) URL to archive.
Default: None

$text

(string) (required) アーカイブテキストの説明文です。
デフォルト:なし

(string) (required) Archive text description.
Default: None

$format

(string) (optional) オプションでです、デフォルトは’html’になります。’link’, ‘option’, ‘html’,またはカスタマイズすることができます。
デフォルト:HTML

(string) (optional) Optional, default is ‘html’. Can be ‘link’, ‘option’, ‘html’, or custom.
Default: html

$before

(string) (optional)オプションです。
デフォルト:空の文字列

(string) (optional) Optional.
Default: empty string

$after

(string) (optional)オプションです。
デフォルト:空の文字列

(string) (optional) Optional.
Default: empty string

返り値

(string) アーカイブの内容にHTMLリンクします。

(string)
HTML link content for archive.

変更ログ

Since: 1.0

ソースファイル

get_archives_link()は、wp-includes/general-template.php内に位置しています。

get_archives_link() is located in wp-includes/general-template.php

Sponsored Link